October 19, 201114 yr I've created a scripted process by which a snapshot link (SNL) is created manually using a series of custom functions. I'm doing this because the creation of the SNL needs to happen server-side, but the resulting SNL is sent to remote users. A native SNL created server side stores a local path to the file which then breaks for those not on the same network. The process works great and I do get a resulting SNL file, but here is the problem.. I need to use a line break to separate the record ID's. I've tried to use the pilcrow character, Char (13) and Char (10), but the resulting SNL file does not respect these characters. If you open the resulting file with a text editor and simply replace the line breaks between each of the ID's, the file works. I've also played with various encoding options both with the global temp field where I store the XML (pre-export) and with the export encoding as well, but no dice. I'm hoping I'm just missing something.. I have attached a demo file and a movie showing what I mean by replacing the line breaks which then works. Any thoughts? snapshotlink.mov CreateSNL.fp7.zip
October 19, 201114 yr When you export as tab-delimited, any in-field carriage returns are converted to vertical tab characters. You could export the global field's contents - but then the file's encoding will be UTF-16 (which may be fine for Filemaker, or not). Have you tried exporting as XML, using a suitable XSLT stylesheet?
October 19, 201114 yr Author Great suggestion.. I modified the script so that it exported the field contents.. The only other modification required was to change the header row of the XML output so that it was also encoded with UTF-16. Meaning, change this: <?xml version="1.0" encoding="UTF-8"?> To this: <?xml version="1.0" encoding="UTF-16"?> It works beautifully now.. Thanks a million!!! I've attached the working file here: CreateSNL_fixed.fp7.zip
October 19, 201114 yr Author Ah.. heck.. spoke to soon.... Export Field Contents is NOT a supported server-side script step.. It seems the only option then must be to export as XML with an XSLT stylesheet, but I'm not at all familiar with creating XSLT stylesheets from scratch. Any advice about how to go about creating a stylesheet to do what I need?
October 20, 201114 yr Author Fascinating! Thank you for taking the time to put an example together. I've learned quite a few things as a result.
October 23, 201114 yr Newbies It's pretty trivial to write an XSL transform to flip out the paths node [of a native snl] with whatever you want. If your server is Mac OS, it's also trivial to perform the transformation via shell script (and maybe on Win too, I just haven't tried it.)
Create an account or sign in to comment