I am currently having an issue with the statusbar app I have been writing in AppleScript. The app consists in a statusbar with a few menu items consistently running while the computer is on. It allows the user to check a small variety of status and performs a couple of system tasks like changing some system setting preferences or starting some apps.
With that in mind, I decided to remove the app dock icon when it is running to only have the statusbar icon displayed so I modified the .plist: (defaults write /Applications/name_of_myapp.app/Contents/Info.plist LSUIElement -bool yes
)
Everything still works but one thing: for some menu items, a click would trigger a dialog box to request confirmation of the action and once I have modified the plist the dialog box does not show up any longer.
set valueRtn to display dialog "Are you sure you want to activate APPXXX?" with icon myIcon buttons {"Don't Continue", "Continue"} default button "Continue" cancel button "Don't Continue"
set buttonRtn to button returned of valueRtn
if buttonRtn is "Continue" then tell application "APPXXX" to activate
Anyone has an idea as to why the line of code here above will not execute any longer? I should add that any other command would work BUT the dialog box.
Thanks in advance for any kind input!
Try this:
After saving the app the first time right-click on the icon and choose "Show Package Contents". Open folder Contents
and then open info.plist
with a text editor. Insert these two lines
<key>LSUIElement</key>
<true/>
the position in info.plist
doesn't matter but the two lines must be inserted right before a <key>
line
Save info.plist
in the Text Editor. Save the project in Script Editor.
Be aware that the customization gets lost when you save the applet with Save as...