hello folks,
i've got a (hopefully) quick question about the power of .plist files; can they run an applescript? more specifically, can a .plist run an applescript when an application is opened?
even more specifically, i want to edit the ableton live .plist to autohide the dock when i open Live.app.
now i have searched enough to find out you can edit the "Application UI Presentation Mode" in the .plist to various settings. this offers either both dock and menu bar gone or (maybe just in this instance with live) the dock disappears as live loads, but once the workspace comes up the dock is back.
in any case, while searching for a better method i found this wonderful applescript through google (here)
(i've replaced photoshop with live here..)
i have tested the script and it works wonderfully. except for the flaws mentioned by the author:
i don't mind the toggle effect as my dock will always be up sans live and i don't really mind that it always runs (i would imagine that this doesn't take up too much computing power). BUT in an effort to learn something here, i was wondering if i could throw a command into a .plist file that would run the script when Live.app was opened and then stopped the script when it quits.
any and all help would be greatly appreciated!
i've got a (hopefully) quick question about the power of .plist files; can they run an applescript? more specifically, can a .plist run an applescript when an application is opened?
even more specifically, i want to edit the ableton live .plist to autohide the dock when i open Live.app.
now i have searched enough to find out you can edit the "Application UI Presentation Mode" in the .plist to various settings. this offers either both dock and menu bar gone or (maybe just in this instance with live) the dock disappears as live loads, but once the workspace comes up the dock is back.
in any case, while searching for a better method i found this wonderful applescript through google (here)
(i've replaced photoshop with live here..)
Code:
property hideApps : {"Live"} --Applications to hide the Dock in
property delayTime : 1 --Time between checks
set dockHidden to false
repeat
tell application "System Events"
--Get the frontmost process
set theProc to name of first process whose frontmost is true
--Check if the dock should be shown/hidden
if theProc is in hideApps and not dockHidden then
--Hide the Dock
keystroke "d" using [command down, option down]
set dockHidden to true
else if theProc is not in hideApps and dockHidden then
--Show the dock
keystroke "d" using [command down, option down]
set dockHidden to false
end if
end tell
delay delayTime
end repeat
i have tested the script and it works wonderfully. except for the flaws mentioned by the author:
The script must be always running to work. If you want to stop it you'll need to force quit it.
It can't detect whether the Dock is currently shown/hidden, only toggle it, so it assumes it's shown to begin with and that its status is never changed manually.
i don't mind the toggle effect as my dock will always be up sans live and i don't really mind that it always runs (i would imagine that this doesn't take up too much computing power). BUT in an effort to learn something here, i was wondering if i could throw a command into a .plist file that would run the script when Live.app was opened and then stopped the script when it quits.
any and all help would be greatly appreciated!