September 28, 200916 yr 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 September 30, 200916 yr by Guest including "code" tags
September 30, 200916 yr Could I ask you to rewrite this message using either the quote or code clauses ... something is evaporated! --sd
September 30, 200916 yr 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.
September 30, 200916 yr 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.
September 30, 200916 yr 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 ]
September 30, 200916 yr 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.
September 30, 200916 yr 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