Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 7, 2013, 03:00 PM   #1
Brradley
macrumors member
 
Join Date: Jun 2010
Syntax Error - help please! :(

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
Brradley is offline   0 Reply With Quote
Old May 7, 2013, 03:59 PM   #2
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
Quote:
Originally Posted by Brradley View Post
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
__________________
Space Corps Directive 34124
kryten2 is online now   0 Reply With Quote
Old May 7, 2013, 04:02 PM   #3
Brradley
Thread Starter
macrumors member
 
Join Date: Jun 2010
Thanks for your help but I get this error message with your code?
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2013-05-07 at 22.01.23.png
Views:	4
Size:	41.5 KB
ID:	411274  
Brradley is offline   0 Reply With Quote
Old May 7, 2013, 04:52 PM   #4
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
Quote:
Originally Posted by Brradley View Post
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
__________________
Space Corps Directive 34124
kryten2 is online now   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:24 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC