Jump to content

Launch an Applet


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

Recommended Posts

Try as I might, I cannot get an AppleScript application to run by launching it through the Perform AppleScript script step.

Correction: It launches, appears briefly in the Dock, quits gracefully, with no error from AppleScript or from FileMaker 8. But it never does anything.

I know it works, because when I launch the very same applet by double-clicking it in the Finder, it runs just beautifully. It will "tell" Finder to have the user select a folder, then it walks that folder, and will "tell" FileMaker to process each file in the folder. FileMaker inserts data correctly.

However, in the Perform AppleScript script step, I have tried to name the file in a calculation, paste it in as a script, "tell" the application to launch, activate it--nothing helps. The script launches, runs and quits, never doing anything.

Any ideas?

Link to comment
Share on other sites

This seems odd to me. If you are running an AppleScript within a Perform AppleScript step, it is not going to appear as a running app in the Dock; it's just FileMaker running it in the background. If you have an external AppleScript applet, you'd normally use Send Event to run it. So you have some funny combo going on here.

Link to comment
Share on other sites

Definitely odd. Where ProcessClips is the name of my applet, I have tried the following (with and without the Finder wrapper) typed into the Perform AppleScript script step:

tell application "Finder"

___activate

___tell application "ProcessClips"

______launch

______activate

___end tell

end tell

The same thing happens. And the icon for AppleScript application clearly shows up in the dock for about 2 full seconds, then disappears as the applet gracefully quits.

Once again, it works fine launched outside of FM. I suspect it has something to do with the fact that the AppleScript has more than two "tell" blocks, and they address both FM and Finder.

Link to comment
Share on other sites

I don't know the correct way to launch an applet by its name. If I try and launch it by just saying:

tell application "Whatever"

activate

end tell

It tries to activate, but cannot finish. AppleScript gives me an error "Can't continue activate". So something more is needed for that. On the other hand, if I tell the Finder to open the file, and give it the full filepath, that works fine.

So, until we figure out what else to do, that will work. If only the filepath relative to the FileMaker database is known, that can also work; construct the path with a calculation field, and pass to the AppleScript run in Perform AppleScript.

Link to comment
Share on other sites

  • 2 weeks later...

I've worked it out using a combination of a Finder "tell" and the Send Event script step.

Thanks for leading me in the right direction once again.

(By the way, I've upgraded to 8.5, and it is sure nice being able to address Layout objects.)

Link to comment
Share on other sites

I've run into another "gotcha" with the Send Event script step.

Apparently, the only way to specify a target Applet is to select a path that is hardwired to the volume you're developing on. If you move the FM database to another volume, it won't find the Applet.

You can provide a relative path (for example, a file in the same folder) only for a "document" or a "do script", but then the user has to locate the target application to open the darned document.

Is there any way to make a solution with "Send Event" portable from drive to drive?

Link to comment
Share on other sites

This topic is 6512 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.