June 17, 201510 yr Running on Mac OS, and need this script to move come files (.jpgs) out of a particular calculated folder/filename sequence. I've got this working in a separate applescript (to install said jpg files), but it's built slightly differently. The issue I'm getting is this: it errors out, and I get "Expected expression but found uknown token."... Not really sure what's causing this, but I suspect it's my escape marks that are not setup properly.... could any kind soul look at this and give me a little feedback? Here's the calculated AppleScript: "set myShCMD to \\\"mv /Volume/FOLDERNAME/FOLDERNAME/ \\\" & CALCULATEDFILENAME & " \".jpg /Volumes/FOLDER2/FOLDER2/\\\"" & ¶ & "myMountAFPVol()" & ¶ & "do shell script myShCMD" & ¶ & "myUmountAFPVol()" & ¶ & "on myMountAFPVol()" & ¶ & " tell application \"Finder\"" & ¶ & " mount volume \"afp://IPADDRESS/FOLDERNAME\" as user name \"LOGINID\" with password \"MYPASSWORD\"" & ¶ & " end tell" & ¶ & "end myMountAFPVol" & ¶ & "on myUmountAFPVol()" & ¶ & " tell application \"Finder\"" & ¶ & " eject \"MOUNT\"" & ¶ & " end tell" & ¶ & "end myUmountAFPVol" & ¶ BTW, this is running in Server 9.0v3, though i'm rather doubtful that matters(?)....
June 18, 201510 yr The issue I'm getting is this: it errors out, and I get "Expected expression but found uknown token."... 1. The formula as presented here isn't valid FileMaker … drop this into a calculation dialog, and you'll get a syntax error. So I'm wondering how you set this up. 2. You can set a variable to the result of the formula (once you've fixed it), or evaluate it in the Data Viewer; then copy that result and try it directly in the (Apple)Script Editor. Debug it there, then make the necessary changes in the FileMaker calc.
June 18, 201510 yr Escaping is messy and error-prone; and it can be avoided. Write your applescript into a text field, using expressions that allow you to perform substitutions to generate the final script. Example in a bit.
June 19, 201510 yr Author 1. The formula as presented here isn't valid FileMaker … drop this into a calculation dialog, and you'll get a syntax error. So I'm wondering how you set this up. 2. You can set a variable to the result of the formula (once you've fixed it), or evaluate it in the Data Viewer; then copy that result and try it directly in the (Apple)Script Editor. Debug it there, then make the necessary changes in the FileMaker calc. This is likely as my background is linux & Mac, not filemaker... so porting various patchwork ideas into FMP... i've typically written stuff in terminal then try to push applescript to run it..
Create an account or sign in to comment