Can someone make me a plugin? - MacRumors Forums
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 Jun 22, 2006, 12:05 PM   #1
sorryiwasdreami
macrumors 6502a
 
sorryiwasdreami's Avatar
 
Join Date: Apr 2004
Location: way out in the sticks
Send a message via AIM to sorryiwasdreami
Can someone make me a plugin?

I've been searching all over the place to find a way to add a contextual menu item to finder. It looks like they can be added using Applescript or via a finder plugin.

Anyway, I can't find the one I'm looking for anywhere. It already exists in os x and is under the "view" menu. It's the "Clean Up" function; it's the action that cleans up icons and aligns them to a grid. What I need is that exact same action under the menu when I right click in a finder windowójust a simple "Clean Up" under the contextual menu upon right clicking.

I really don't want an application to handle this or any complicated solution. The key is to simply right click and select it. It would work in any finder window's contextual menu. Having this would really speed up my workflow.

Does anyone know where to get such a plugin/Applescript? Does anyone know how write one (or know how to copy the existing one)? That would be exquisite.
__________________
avataróJoan Miro, Chiffres et Constellations, 1941
sorryiwasdreami is offline   0 Reply With Quote
Old Jun 22, 2006, 02:28 PM   #2
XNine
macrumors 68040
 
XNine's Avatar
 
Join Date: Apr 2005
Location: Why are you wearing that stupid man suit?
Automator is your friend.
__________________
On Diebold: "i went to get cash last night and ended up voting republican. wonder how much that's gonna cost me." -Zimv20
XNine is offline   0 Reply With Quote
Old Jun 22, 2006, 02:35 PM   #3
sorryiwasdreami
Thread Starter
macrumors 6502a
 
sorryiwasdreami's Avatar
 
Join Date: Apr 2004
Location: way out in the sticks
Send a message via AIM to sorryiwasdreami
Can you tell me how to do this with automator? I must have skipped something.
__________________
avataróJoan Miro, Chiffres et Constellations, 1941
sorryiwasdreami is offline   0 Reply With Quote
Old Jun 22, 2006, 03:02 PM   #4
XNine
macrumors 68040
 
XNine's Avatar
 
Join Date: Apr 2005
Location: Why are you wearing that stupid man suit?
Well, you build your actions in Automator, and then when you're done you SAVE AS... Finder Plugin and it puts it under the contextual menu. I'm pretty sure thsi can be done in automator, but I'm at work right now and don't have access to automator here.

IF need be I'll build the script and host it for you to DL.
__________________
On Diebold: "i went to get cash last night and ended up voting republican. wonder how much that's gonna cost me." -Zimv20
XNine is offline   0 Reply With Quote
Old Jun 22, 2006, 03:08 PM   #5
sorryiwasdreami
Thread Starter
macrumors 6502a
 
sorryiwasdreami's Avatar
 
Join Date: Apr 2004
Location: way out in the sticks
Send a message via AIM to sorryiwasdreami
I have used Automator to build several workflows such as setting my display to sleep or remain awake, rename, and combine pdfs. But, I used actions that were already present in automator to do this and then save as plugins.

So I understand how to save automator actions as finder plugins, but I don't know how to import an action in order to make it available for use.

Any help would be very much appreciated; I'm interested in learning how to do this.
__________________
avataróJoan Miro, Chiffres et Constellations, 1941
sorryiwasdreami is offline   0 Reply With Quote
Old Jun 22, 2006, 03:40 PM   #6
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
See attached (created in Automator). You need to unzip this and save it in ~/Library/Workflows/Applications/Finder/

So how did I do it?

To start with I looked at the available Automator actions and realised none of them would help.

So I fired up the script editor and opened the Finder dictionary and quickly find the Clean Up command.

So I wrote this script:

Code:
tell application "Finder"
	tell front window to clean up
end tell
which seemed to work (it tells whatever the front-most Finder window is to clean up.

So I then looked into Automator and found the AppleScript action in the Automator section. A quick copy and paste of that code and I was done.

Enjoy
Attached Files
File Type: zip Clean Up.workflow.zip (1.7 KB, 11 views)
robbieduncan is offline   0 Reply With Quote
Old Jun 22, 2006, 03:44 PM   #7
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
OK I've found an annoyance: the Finder window you right click in looses focus

To fix this change the code in the action to

Code:
on run {input, parameters}
	
	tell application "Finder"
		tell front window to clean up
		activate
	end tell
	
	return input
end run
(Note the activate line)
robbieduncan is offline   0 Reply With Quote
Old Jun 23, 2006, 11:18 AM   #8
sorryiwasdreami
Thread Starter
macrumors 6502a
 
sorryiwasdreami's Avatar
 
Join Date: Apr 2004
Location: way out in the sticks
Send a message via AIM to sorryiwasdreami
Wow awesome! I didn't know there were these "dictionaries." Thanks for all your help!

I am getting errors with the script, but I am looking into it and trying to figure out why.

Thanks again.
__________________
avataróJoan Miro, Chiffres et Constellations, 1941
sorryiwasdreami is offline   0 Reply With Quote
Old Jun 23, 2006, 11:32 AM   #9
sorryiwasdreami
Thread Starter
macrumors 6502a
 
sorryiwasdreami's Avatar
 
Join Date: Apr 2004
Location: way out in the sticks
Send a message via AIM to sorryiwasdreami
Where in the Finder dictionary can you see the actual scripting code for these things? How do you show it?
__________________
avataróJoan Miro, Chiffres et Constellations, 1941
sorryiwasdreami is offline   0 Reply With Quote
Old Jun 23, 2006, 11:43 AM   #10
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by sorryiwasdreami
Where in the Finder dictionary can you see the actual scripting code for these things? How do you show it?
What do you mean by "actual scripting code"? The dictionary tells you about the objects that are available and the properties and methods those objects expose. That's all you need.
robbieduncan is offline   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

Similar Threads
thread Thread Starter Forum Replies Last Post
64 bit QuickTime plugin? ArtOfWarfare Mac Programming 1 Jul 28, 2013 02:22 PM
Plugin for Shadows? majordude Design and Graphics 2 Apr 14, 2013 07:26 PM
Just Throwing This Out There About Flash Plugin 53kyle OS X 10.8 Mountain Lion 13 Feb 8, 2013 03:49 PM
developers can make some rad apps/games..do you think they could make a facebook app? aliensarecool Wasteland 1 Aug 25, 2012 04:16 PM
facebook plugin for ML? ihonda OS X 10.8 Mountain Lion 1 Jul 24, 2012 04:08 PM

Forum Jump

All times are GMT -5. The time now is 09:20 AM.

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

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