Convert Filemaker 18 Runtime To macOS App - Applescript (Reposted With Code)

I’d like to convert a Filemaker 18 Runtime to a Mac (Catalina) application package.

I found a youtube video that describes how to do this using the following Applescript:

– Path to the runtime in the app
set appPath to {{{path to me} as text} & “Contents:Resources:myApp:myApp:app”}
– Convert path to a POSIX path
set newAppPath to POSIX path of appPath
– executing the script file
try
set command to "open " & newAppPath
do shell script command
end try

but it’s 13 years old, so I don’t know whether my failure to get it to work is due to the technology having moved on.

I keep getting the script error:

Can’t get POSIX path of {{“Catalina:Users:lara:Documents:myApp app create.app:”, “Contents:Resources:myApp:myApp:app”}}.

Thanks in advance for any advice.

Regards,

Lara

That first line uses braces where it should use brackets, and waayy too many of them. Try this:

set appPath to (path to me as text) & "Contents:Resources:myApp:myApp:app"

(to get code to display as such enclose it with 3 backticks ```)

1 Like

Alastor, thank you very much for the reply.

The script works now without error, but doesn’t create the app ‘shell’ (wrapper?) anticipated.

Are you able to suggest how I might amend it to create an empty app package (that I might pack with a Filemaker runtime)?

Thanks in advance for any advice.

Regards,

Lar

That’s not what it is supposed to do. It just opens whatever you put in as ’ myApp:myApp:app’.

You have to save the script as applet (AppleScript application) before you can drop in that Filemaker thingy. After you’ve done that, the rightmost button in the editor’s toolbar will become active. Click it to open access to the bundle’s Resources folder, and you can drop the runtime there. Make sure you put in the actual names in the appPath variable. Save changes, and quit editor. Double-click applet to test.

Tip: to see any errors that might occur when it looks for the runtime you should remove the try and end try lines from the script.

And, ahem, you can now forget about the shell script.

Alastor,

Thanks for the reply.

It works!

Unfortunately, though I’ve created my package, and copied my FM Runtime to the Resources folder, nothing happens when I click my app icon. Rather, the icon bounces up and down like mad on the toolbar, then shrinks and disappears. I’m guessing/hoping that this is because I haven’t signed my app…?

This is my first rodeo when it comes to mac development (surprise!). Though FM is cross-platform, I’ve never had to ‘mac’ in nearly thirty years of development; so, it’s an alien intelligence to me.

I’ve struggled to come to terms with the difference between an app package, and an installer package. The situation isn’t helped by the fact that the process of creating an installer for my app seems to involve signing three ‘packages’ (?), and will be partially handled by a program called ‘Packages’. Consequently, googling for help has confused as much as enlightened.

Anyway, thanks again for the heads up.

Regards,

Lar

An AppleScript, in whatever form, should run on the machine where it was created, without signing. Not sure about applets being run elsewhere.
But if it needed signing it should tell you that, not just open-and-close.

You could run the applet in the editor, to see what it is doing. The window’s bottom bar has 3 buttons. Click the rightmost one to see the event log, and run the script: watch it do its thing. You did remove the try/end try lines?

Hi. It’s been a few years since I tried something like this, but historically I don’t think it was usually possible to reverse a Filemaker Runtime back into a normal FileMaker Pro file, as it stripped out some essential stuff.

Alastor,

Thanks for the info and for being so patient.

I’m out of ideas. I’ve tried just about everything to get my runtime to open under the app package, without success.

If I run the Applescript within Script Editor, I see the following in the Result window:

“Catalina:Users:lar:Desktop:myapp.app:Contents:Resources:myapp:app”

When I click the icon on the desktop, as reported previously, the icon bounces on the taskbar, then either:
(a) disappears without cueing my runtime,
or
(b) settles on the taskbar and heralds a message ‘Press Run to run this script, or Quit to quit’ (neither option does anything).
In both cases, the icon remains on the taskbar, and the app in the Activity Monitor, but it doesn’t open.

I’m puzzled because the runtime opens from the FM launch file (i.e. myapp.app).

Please don’t waste any more of your time on this.

Thanks again for all of your advice.

Have a good weekend.

Regards,

Lar

Kerflooey,

Thanks for replying to my query.

It’s probably my fault for not expressing myself properly but I’m not attempting to extract the original FM file from my runtime. I’m trying to wrap my runtime in an application package, so to speak, so that it will look like any other Mac application to a user.

This video describes the process (minute 03:03):

0:24 / 10:49

FileMaker Runtime Packages and Installer

Trouble is it’s 13 years old!

Regards,

Lar

Ah, I see what you mean now. That might be doable with some OS trickery, I forget.

When a Filemaker runtime quits, doesn’t it display a quick “Made with Filemaker” dialog that you might want to change/suppress too?

I’m not trying to hide the fact that my runtime is an FM solution, just make it easy for users to install it in a professional manner that satisfies the Mac OS’s security standards.

I expressed myself poorly, but that’s what I meant by converting ‘a Filemaker 18 Runtime to a Mac (Catalina) application package’.

Regards,

Lar