I have an AppleScript scheduled to run every several minutes with launchd. The script makes some adjustments in System Preferences. However, whenever it runs, the System Preferences icon appears on the dock for a few seconds.

Is there any way to prevent displaying the dock icon when the script is run? I have seen suggestions that involve modifying metadata in the app, which I would like to avoid. Or maybe it's possible to prevent it from within the script, which works like this:

tell application "System Preferences"
    reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell

tell application "System Events"
    tell process "System Preferences"

        (* do stuff *)

    end tell
end tell

quit application "System Preferences"

I suppose it's also possible to do this using something other than AppleScript, which would also be an acceptable answer, as long as it is able to read and write System Preferences values.

You must log in to answer this question.

Browse other questions tagged .