Jump 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.

Passing data out of FMP using Applescript

Featured Replies

This is a very basic question, I know, but I am having a devil of a time using Applescript to send field contents to another application.

I have a field called Applescript1 which is a Global field and it contains the first part of the Applescript code:

tell application “Dialectic”

dial number “




I'm using a script parameter to capture a phone number field. Here is the Calculated Applescript:




Dash::Applescript1 & Get ( ScriptParameter ) & Dash::Applescript2




Here is the contents of the field Applescript2:




“

end tell

When I run the script I get the message:

"Expected end of line but found class name"

Unknown Error: -2741.

I can't figure out what is wrong. Any help is appreciated.

Thanks much,

Brian

Edited by Guest
including "code" tags

Could I ask you to rewrite this message using either the quote or code clauses ... something is evaporated!

--sd

No, Søren, it's all there. It's just an odd way to put an AppleScript together. The fact that it uses a calculated AppleScript, with a script parameter means there is no easy way to even see what the resulting AppleScript is. I put it into a script Variable, then ran with Script Debugger on, to see the result. But the original poster does not have FileMaker Advanced, so I don't think they can do that (or can they?).

Nor can they see it in a calculation field, as field calculations do not support Get ( ScriptParameter ). What they do support is global fields and global script Variables. So you could set your script parameter into a $$variable, then see the resulting calculation. For example (modified to do something I can do):

tell application “Finder”

open file “Macintosh HD:Users:fej:Desktop:Open via AS.fp7“

end tell

Basically, your calculation should work, if Dialectic supports that command in that format, which I don't know.

  • Author

Are you saying that Get (ScriptParameter) doesn't work in the way I'm using it or just there is no way to confirm the Applescript that is being generated with the way I am using it?

Also ho would I set a script parameter to a global variable?

Sorry, I'm still pretty novice.

Thanks for the help.

I put it into a script Variable, then ran with Script Debugger on, to see the result. But the original poster does not have FileMaker Advanced, so I don't think they can do that (or can they?).

They can, by:

Show Custom Dialog [ $variable ]

Ah, yes, I remember now, the old "debug with dialogs". bb84604, your script works fine for me (tho I don't have Dialectic, so cannot test that). So there must be something else, which you need to see, as comment suggested.

P.S. You set a script Variable with the Set Variable script step. You make it global by using 2 dollar signs ($$). Read about it in the Help.

  • Author

OK. Now I'm really puzzled.

Thanks to your good advice I did the custom dialog to capture/view the applescript being generated and it looks perfect.

However it still gives me the same error and doesn't run the script.

I tested the identical script in the Applescript Script Editor and it works fine.

Any ideas??

Create an account or sign in to comment

Important Information

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

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.