Hide Applescript Prompt

amccarty
New Contributor III

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:

a0c316723a6c44d08c4158a7f9a43aee

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!

1 ACCEPTED SOLUTION

ryan_ball
Valued Contributor

@amccarty Is the .app created with Automater? If so have you tried Platypus to see if that acts any differently? You can easily create a .app with Platypus from a script that might act differently.

View solution in original post

7 REPLIES 7

ryan_ball
Valued Contributor

@amccarty Is the .app created with Automater? If so have you tried Platypus to see if that acts any differently? You can easily create a .app with Platypus from a script that might act differently.

amccarty
New Contributor III

@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.

amccarty
New Contributor III

@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.

isaacnelson
Contributor

@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?

8a91673fa11a48869b536bb027269107

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.

ryan_ball
Valued Contributor

@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!

amccarty
New Contributor III

@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.

isaacnelson
Contributor

Very strange. Glad you've got it working now. Platypus is a great tool, too!