Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7459 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Ok here's my situation. I have a filemaker script that does a few things and then eventually calls and applescript which presents the user w/ a few choices of what to do next. The only problem is i want one of those choices to allow the user to cancel the script but I can't figure out how to do this. I looked through the filemaker applescript dictionary and didn't see anything of use and my other idea was to somehow use a filemaker "If" and "Exit Script" script step but i can't figure out how to define a applescript result in scriptmaker nor can i find a way to call these steps directly from applescript. If anybody has any ideas please post here.

Posted

You create a FileMaker script, then call it from the AppleScript script, using:

do script FileMaker script "Script Name"

It cannot stop further processing by the AppleScript however, not even if the FileMaker script has a Halt Script step. So you have to either handle the branching within the AppleScript.

Or modularize the AppleScript into parts, each in its own FileMaker script, then call them from a FileMaker dialog, using Get (LastMessageChoice) to branch.

It's more compact to do the processing within AppleScript. You can use the "try, on error, return" construct (see file).

UserCancel_AS.zip

Posted

Hi thanks for your help. I just wanted to mention that the script I want to stop was a scriptmaker script and not the applescript b/c i wasn't sure if I had made that too clear. I wanted to do the processing inside of the applescript but there doesn't seem to be anything in the filemaker pro applescript dictionary to allow applescript to stop running a scriptmaker script and that is why i was looking for alternate methods. If you have any more ideas please post back. Also, could you please elaborate on what the function Get (LastMessageChoice) does and if you could explain your idea modularizing the applescript more I would be very appreciative.

Thanks a lot,

Christopher Kiernan

Posted

Create a standard Filemaker script, "Halt" with a single statement: halt script. In your applescript:

if whatever

do script FileMaker script "Halt"

else

-- do your regular stuff

end if

Posted

Bruce answered the question on stopping the FileMaker script. I didn't realize that's what you were after (though now it's obvious when I read your original question (I had a Halt step in mine, but removed it, as it wasn't needed; duh).

Get (LastMessageChoice) is just 7's terminology for what was Status(CurrentMessageChoice) in 6. The idea about modularizing the AppleScript just meant to break the AppleScript into it's smaller parts, make each of those a separate FileMaker Perform AppleScript [] script, then use FileMaker's Custom Dialog step to handle the branching. It would be better to do in AppleScript though, much more compact, and more robust, considering the current limitations of FileMaker's dialog in passing data only via the default button (which I don't see why they think is intended behavior).

This topic is 7459 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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