January 2, 200620 yr When I use Apple's Script Editor I can run my little applescript without any problems. However I can't enter the same commands in filemaker's "Perform Applescript" script step because it gives me the following error: Expected end of line, etc. but found ")". Here are the applescript commands: set MyFile to open for access (path to desktop as text) & "Results.txt" with write permission write (the clipboard as text) to MyFile close access MyFile The script creates a text file on the desktop using the contents of the clipboard. Any ideas about why filemaker objects? Edited January 2, 200620 yr by Guest
January 2, 200620 yr Hi, Yes there is a problem with a Write command in applsecript in conjusction with FM. There are two alternatives.. Create a separate applescript with ONLY that command and call it from your script.. OR Create an applicatio of the entire applescript and call the application.. Regards, MetaSys
January 2, 200620 yr You can use "write" inside a Perform AppleScript step, but you have to wrap inside another tell app block, like this: set theFile to ((path to desktop as string) & "Results.txt") tell application "Finder" set MyFile to open for access theFile with write permission write (the clipboard as text) to MyFile close access MyFile end tell
January 2, 200620 yr However do I have reservations, using the clipboard is bad practice from a developer not quite aware of his jurisdiction. At least must measures ensure that the users data in the clipboard is saved before tampering with it, so it can be reinstated when the script is done! But with fm8 shouldn't Copy All Records be needed, except when exorbitant speed is required, GetNthRecord in a recursive CF is much safer in it's dealings. Try to investigate Fentons template here: http://www.fmforums.com/forum/attachment.php?attid/3566/ ...and notice how you can do it with shell scripting especially his CAR_ example is nice when you fix a tiny error in the first line, he forgot to make the refernce to a hidden field! --sd
Create an account or sign in to comment