How to hide a an Apple Script Application
Is there a way to hide an apple script application or make the apple script application to hide itself?
-Thanks
Joe
Is there a way to hide an apple script application or make the apple script application to hide itself?
-Thanks
Joe
Not really, you can play with the visibility of the application like any other, but anyone that looks hard enough is going to find it. What exactly is it you are trying to do?
This will check to see if the script is hidden or not, and then take the opposite action. Red Menace's observation, and question bear more consideration.
set scriptPath to POSIX path of (path to me as text)
tell application "System Events" to set is_visible to (visible of disk item scriptPath) as boolean
-- wanted to use pure applescript in if block below, but setting visible on and off very unreliable, or inoperable.
-- tell application "System Events" to set visible of disk item scriptPath to false
if is_visible then
do shell script "chflags hidden " & scriptPath's quoted form
log "Hidden"
else
do shell script "chflags nohidden " & scriptPath's quoted form
log "Unhidden"
end if
return
Hide it from the dock.
In your application's Info.plist, edit the key LSUIElement (in Xcode's property list editor it is also listed as Application is agent) and set its value to Yes/True. This will also hide the main menu bar - you get all or nothing.
You just need to add the key - from Xcode's editor, right-click and choose Add Row, then pick LSUIElement from the popup list. Again, this also hides the application menu, so I am going to guess that you have some other way to control the application.
This worked!!!! Thank you so much!
How to hide a an Apple Script Application