Launch a script from FileMaker

I’m trying to get FileMaker to launch an external script, rather than embedding the AppleScript inside FileMaker itself.

I was experimenting with getting one AppleScript to launch another using this technique…

Remote launch of a script

…but didn’t get it to work. Mostly just got very odd behavior that destabilized my system requiring reboot. :expressionless:

Here’s what I was trying:


set app_name to "Server:Folder:Subfolder:Subsubfolder:Test.app"
--real path obfuscated to protect my employer

using terms from application "Test"
	tell application app_name
		activate
	end tell
end using terms from

The test application (script compiled as an app) contained, just as a test:


tell application "Safari"
	make new document
end tell

But launching the first script did nothing but “stutter” the dock, as if it tried to launch something and failed. Couple go-rounds with various other ideas eventually cause Script Debugger and Finder to start fighting with each other over the viability of files being saved, corruption ensued. So something odd was going on. :o

All my testing so far has been outside of FileMaker, just proof of concept to see if I can get it to work (getting one script to launch another) before embedding the first script into FileMaker.

Ciao Kevin,

did you try run script instead?
If I put this code in the AS Code window of FileMaker

set myScript to alias "Macintosh HD:Users:farid:Desktop:entScarica.scpt"
run script myScript

and connect it to a button, one click will trigger the script defined by myScript.

Good scripting
Farid

It’s the simple things that are sometimes the coolest. :smiley:

Worked like a charm. I hadn’t thought about that since I thought it would leave the script open. Guess it just runs it then quits it automatically, very nice. Apple won-back a few points for that one.

Thanks Farid!