Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Brradley

macrumors member
Original poster
Jun 21, 2010
90
2
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!

Code:
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

macrumors 65816
Mar 17, 2012
1,114
99
Belgium
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!

Code:
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 :

Code:
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

macrumors member
Original poster
Jun 21, 2010
90
2
Thanks for your help but I get this error message with your code? :(
 

Attachments

  • Screen Shot 2013-05-07 at 22.01.23.png
    Screen Shot 2013-05-07 at 22.01.23.png
    41.5 KB · Views: 148

kryten2

macrumors 65816
Mar 17, 2012
1,114
99
Belgium
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.

Code:
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.