Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.3: Record Finder actions in Script Editor' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Record Finder actions in Script Editor
Authored by: jasongutierrez on Oct 30, '03 01:43:00PM

About time...
I saw that Apple released a beta version of this a few weeks ago (maybe earlier). It's interesting that if you copy this over to 10.2.8, recording doesn't work. I guess this is one more reason to migrate to 10.3.



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: nvdingo on Oct 30, '03 02:16:04PM

if you are referring to copying the new script editor over to 10.2.8, it's not that surprising, the finder itself in 10.2.8 wasn't scriptable. doesn't matter what version of the editor you are using.

on another note, another reason this is good is this.
if you are a consultant, and you have clients that like to arrange their icons a certain way on the desktop, and complain everytime they get moved (by screen resize temporarily, or other)

all you do is record yourself selecting all, and dragging the group over by one pixel

stop recording, and voila
you have a script that will move all the icons back into place.
i then use a regex in bbedit to wrap try/end try statements around each one, so that it doesn't bonk if an icon is missing.

my dad is my number one fan of this feature, and until now, i couldn't do it since i switched him to X
thank goodness it's back.



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: nvdingo on Oct 30, '03 02:23:26PM

of course, i open my big mouth and try it, and it doesn't work. dang. back to the drawing board. guess i am going to have to do it programmatically instead of the easy way.

any one know how to get the icon position data if you know the file name?

i mean, i figure i get a list of files that are in ~/Desktop
and get the position of all icons and spit it out.

if i were really good at AS, i would set a property if the option key was held down during run, and then use the stored icon position info in future runs (not option key modified) to set the positions using a loop.

but i just haven't figured that part out yet.



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: Graff on Oct 30, '03 05:16:02PM
any one know how to get the icon position data if you know the file name?

I know that you can get the positions of the icons with the following short example script:

tell application "Finder"
	set desktopList to every item in the desktop
	repeat with theItem in the desktopList
		set thePosition to the position of theItem

-- Do something here with thePosition

	end repeat
end tell

The key is that you have to use the reference desktop. The path ~/Desktop/ is something completely different and it doesn't contain the position of the icons.



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: nvdingo on Nov 01, '03 08:45:27PM

thank you!!!
i was grappling with that.
i don't get the object model enough to figure it out.

i opened the finder dict and tried to figure out what to do.
about 2 hours of fiddling, and i figured out how to do a lot, but not move the icons.

i had the wrong set of classes referencing the icons.

thanks graff!



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: robJ on Oct 30, '03 05:22:22PM

Script Editor has had the ability to record for a long time. An application must specifically support recording for it to work. Panther's Finder is the first OS X Finder to support recording.



[ Reply to This | # ]