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

Posted on Nov 19, 2016 2:53 PM

Reply
7 replies

Nov 19, 2016 4:39 PM in response to asker12

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

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to hide a an Apple Script Application

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.