Posted on 04-04-2019 05:43 AM
I've exported an Apple script as a .app file which mounts network shares and runs constantly in the background. I've got a launch agent for the app with keep alive set, and in the info.plist file for the app i've set LSUIElement so that it's always hidden.
That's all worked great, however, if a user holds down the control key while the script is running a prompt will appear with the app name asking if you want to run or quit the script:
Does anyone know a way of preventing that? I'm sure it's probably something very simple but I can't seem to find anything about the control key causing this prompt for silent apps.
Note: I'm sure someone will probably suggest using NoMad instead for share mounting, so I should probably mention here we have previously used NoMad and had a number of issues with it and eventually moved away from it in favour of this method, it just works better for us!
Thanks!
Solved! Go to Solution.
Posted on 04-04-2019 06:07 AM
Posted on 04-04-2019 06:07 AM
Posted on 04-04-2019 06:17 AM
@ryan.ball Nope not Automator, I've just created it with the built in "Script Editor". Never used Platypus but i'll try exporting it from there and see if I get the same behaviour.
Posted on 04-04-2019 08:31 AM
@ryan.ball Tried it, and you were right I don't get the prompts any more after using Platypus to create the script. Thanks! Will definitely be using Platypus more going forward, it saves a lot of time having to manually tweak the contents of .app files.
Posted on 04-04-2019 08:32 AM
@amccarty When you export your script as an application from Script Editor there should be a checkbox labeled "Show startup screen." Is that unchecked for your script?
Also, if you're doing much with AppleScript I would highly recommend using Script Debugger from Late Night Software instead of Script Editor. Even the free version of SD is lightyears ahead of Script Editor.
Posted on 04-04-2019 08:33 AM
@amccarty Great! You can also save profiles for specific projects in Platypus, so that you don't have to redo the settings over and over if/when you make changes to the script. Good luck with it!
Posted on 04-04-2019 08:40 AM
@isaacnelson Yeah that was unchecked, it wasn't showing every time the script started just on holding control down for a few seconds, but I think i'm good now it seems to be ok after re-exporting without using Script Editor. Thanks, I'll have a look at the debugger too i'm sure it'll be of use at some point.
Posted on 04-04-2019 09:06 AM
Very strange. Glad you've got it working now. Platypus is a great tool, too!