Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Applescript syntax?

Featured Replies

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 by Guest

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

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

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.