Is AppleScript here to stay? Or should I use another trigger?

I use Filemaker Pro extensively and to date, the easiest way to trigger the old quickeys and now the new KM from within Filemaker has been AppleScript (AS).
I’m just starting to rewrite my 30 years in the making Quickeys library, which will take me oh, 5 or 6 years!!! LOL, (really will probably…) - but the question is.
Does anyone have an opinion about: Will AppleScript be around on the mac and supported for numerous years to come so that my ‘AppleScript triggers from FIlemaker’ are still valid, OR, should I figure out another trigger type?
I could set the trigger to be:
This application running “Filemaker Pro”, and repeat every one second
then do an if/then, that checks if the clipboard contains ‘xyz’ and then run the macro.
But isn’t this type of approach taxing on the system? to run the check every second?

  • It would be great if there was a ‘native’ trigger that was ‘when clipboard contains’.
    I would just use that, no AppleScript, no trigger testing every second, and be done.
    Any thoughts would be appreciated.

( I did just discover I could use the initial trigger as “System Clipboard Changes” and then the if/then with ‘if clipboard contains’ ‘XYZ’, so in Filemaker I could just ‘copy’ the ‘if/then clipboard text’ ‘XYZ’ in an always present global field and the macro would run.) hmmmm ( I hope that made sense, I need to get better at posting these arcane questions.)

If FileMaker can open a URL, the using the URL trigger may be easier.

AppleScript likely is going to be with us for a fair while yet. Plus Apple just invested in JXA which is basically a JavaScript language parallel to AppleScript. So I wouldn’t worry about using AppleScript to trigger macros - far better than watching the clipboard.

BTW, there is a clipboard changed trigger too, so polling for a clipboard change would be unnecessary.

Great, FMP can open URL’s so I’ll work with that.
I only need to use one line of the following, correct?
They are all different ‘code’ for the same macro.
I tried all of the following as single lines in FMP and it’s not triggering.
Of course in a browser, they do trigger.
google.com does trigger in FMP, the following do not.
thoughts?

kmtrigger://macro=Z%20Test%20Display%20FMP
kmtrigger://macro=BD820268-4139-48EE-8E89-6E612C615013
kmtrigger://macro=Z%20Test%20Display%20FMP&value=Whatever
kmtrigger://macro=BD820268-4139-48EE-8E89-6E612C615013&value=Whatever

The corresponding applescripts run from FMP fine. just not the urls.

Correct, one line. They are variants of the same code depending on your usage (by name, or better but less readable, by ID, with or without a parameter).

FMP may restrict the URLs to http/https or other known URLs. Or it might be something else, it is hard to say why it might not work. There may be a note in the Engine.log file if the URL gets as far as Keyboard Maestro. But if the URL fails on the FMP side for some reason, then there isn’t much I can suggest unless it has some logging or error reporting.

You could ask on the FileMaker forum I suppose.

I agree with Peter that AppleScript is likely to be around as long as macOS is.

(Perhaps the main threat to it is just iOS, now Apple’s main platform, in terms of revenues and user numbers, and hence also in terms of investment.

AppleScript on iOS seems unlikely, though JavaScript is already variously embedded there – browsers apart, Drafts and 1Writer are the first to come to mind).

thank you both - much appreciated

I don’t think it gets to KM, there is nothing in the engine.log
Maybe I’ll ask on the FMP forum.
I would like to get it to work, it seems the best way to trigger a KM macro from FMP, IF , I can get it to work =) ,
cheers

I'm not sure why you're shying away from using AppleScript - it works just fine, and as others have said, it's extremely unlikely it will go away. And if you've already been using AS for QK, I think it's a no-brainer.

As far as FMP and KM URLs not working, I've got other apps that have the same issue, unfortunately. But maybe you'll get lucky and the FMP developers will listen to you.

If you'd rather go some other way, you could consider writing "trigger" files to a folder, and have a macro that triggers when files get added to the folder. You could have the filename be either the name of the the macro, or the UUID. I'd prefer the UUID, since it's unique, and will always be a valid filename. If the macro requires a parameter, you could put that in the file's contents.

So basically, FMP would write an empty text file (or whatever) to a specific folder, and name it the UUID of the macro to run.

The macro monitoring that folder would get the name of the file, delete the file, then run the macro.

I assume you already know how to launch the desired macro, but if not, this can get you there (this works with UUIDs also, in spite of the name):

Thanx Dan,
I’ve appreciated all the input.
I’ve just been so paranoid over the years of AppleScript going away, goes back to the days in the early 90’s when there was talk of the mac going away! - OH NO
All said and done, you’re right, AS has been and does work very well, - no brainer -
Part of this process for me has been to ask and learn, and it’s been great.
So I started with AS, and I end up with AS, but picked up so much inbetweeen.
Thanx to you and the other awesome folks in this community. GOOD STUFF!

  • I like your ‘execute macro by name’ macro, I’ve added it to my ‘to look at’ and understand folder.

Yeah, that's one of the main reasons I read this forum - that, and, obviously, to help people. But I learn so much, it's amazing. Talk about having fun while you learn!

1 Like