PDA

View Full Version : Syntax Error - help please! :(




Brradley
May 7, 2013, 03:00 PM
I found this applescript online that should remove finder from the dock on startup if I save it as an application and add it to login items. I go to save it and it says "Expected expression, property or key form, etc. but found unknown token." Can anyone help please? Thank you!

on run {input, parameters}

tell application “System Events” to tell UI element “Finder” of list 1 of process “Dock”
perform action “AXShowMenu”
click menu item “Remove from Dock” of menu 1
end tell

return input
end run



kryten2
May 7, 2013, 03:59 PM
I found this applescript online that should remove finder from the dock on startup if I save it as an application and add it to login items. I go to save it and it says "Expected expression, property or key form, etc. but found unknown token." Can anyone help please? Thank you!

on run {input, parameters}

tell application “System Events” to tell UI element “Finder” of list 1 of process “Dock”
perform action “AXShowMenu”
click menu item “Remove from Dock” of menu 1
end tell

return input
end run

Try this :

on run {input, parameters}

tell application "System Events" to tell UI element "Finder" of list 1 of process "Dock"
perform action "AXShowMenu"
click menu item "Remove from Dock" of menu 1
end tell

return input
end run

Brradley
May 7, 2013, 04:02 PM
Thanks for your help but I get this error message with your code? :(

kryten2
May 7, 2013, 04:52 PM
Thanks for your help but I get this error message with your code? :(

You can save this in Automator as an application with a Run Applescript action.
In Applescript Editor as an application by removing the {input, parameters} part in the on run handler.

on run
tell application "System Events" to tell UI element "Finder" of list 1 of process "Dock"
perform action "AXShowMenu"
click menu item "Remove from Dock" of menu 1
end tell
end run