August 5, 201213 yr HI, I have an applescript that selects the name and path of an XML file that id like to then parse into filemaker. I have tried using "Set Variable" to do this but cannot make the link between the applescript and $VariableName. It is currently not working and is hard to find any examples on the web. Any help is much appreciated. It would look something like this. (which is SO NOT working) Filemaker Script Perform Applescript: global file2open set file2open to (choose file) set file2openName to POSIX path of file2open set $theFile to file2openName Set Variable: [$FileToImport; Value: "filemac:/"& "$theFile"] Import Records: [No dialog; $theFile; myxslt; Add; Mac_Roman]
August 5, 201213 yr Try using a global FIELD. I'm no AppleScript expert, but I'm sure I've seen this before.
August 5, 201213 yr You can only set fields via AppleScript. No Variables, no parameters for scripts. Very much like it was introduced in FMP3. Try this minimal demo. aedemo.zip
August 5, 201213 yr Author Thanks Karsten, That looks promising, a little backwards yes, but it looks like the only option. How do I then bring that field in you demo back into the "import fields" dialog as the file path to import? Cheers
August 6, 201213 yr Same thing you would do if you weren't using applescript. Set Variable: [$FileToImport; Value: "filemac:/"& yourTO::yourField
August 6, 201213 yr Author Hi, Sorry, Im not familiar with yourTO::yourField . A quick google didn't help much either. Please explain a little more the use of this cast. Many thanks.
Create an account or sign in to comment