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

10.3: Record Finder actions in Script Editor Desktop
Apologies if this is common knowledge, but the new finder in Panther is AppleScript recordable. I don't think it was in Jaguar...

[robg adds: It may be common knowledge, but I sure don't remember it being discussed by Apple or elsewhere on the net. A quick test confirms that, indeed, you can now once again (you could not do so in Jaguar) record Finder actions with the Record button in Script Editor. This is a great feature for us rookie scripters, as it makes it very easy to write useful, basic scripts.]
    •    
  • Currently 1.60 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[10,163 views]  

10.3: Record Finder actions in Script Editor | 15 comments | Create New Account
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: diamondsw on Oct 30, '03 11:50:00AM

However, you still can't script things like setting thumbnail icon view, copy and paste of icons, etc. Someone correct me if I'm wrong...



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: DeltaTee on Oct 30, '03 12:55:53PM

I have a script I am still upgarding from Jaguar which changes a window to icon view, maximizes the icons, then turns on the auto-thumbnail generation. The tricky part is doing the auto-thumbnail generation since that has to be done using the GUI scripting...

Send me an email or post here if you are looking for more information (or want a copy of the script).



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

I would *love* that. I have tried to use GUI scripting to get at the checkbox in question but couldn't quite make it work. Submit that puppy as a hint. :)

Of course, it would be nice if Apple went back and took care of loose ends like this. I'd love to see a 10.3.1 that fixes the firewire drive problems (reported elsewhere) and see 10.3.x fix and clean up a lot of these missing pieces.



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: jonn8n on Oct 30, '03 04:32:01PM
While it does not support turning on the icon previews, my application Finder Window Manager can help with arranging your Finder windows to your specifications. You can find out more information from:

http://homepage.mac.com/jonn8/fwm/

Jon Nathan

[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: diamondsw on Oct 31, '03 03:58:58PM

It's appreciated, but the only thing I want is turning on the tumbnails. Everything else I can AppleScript (and I guess with enough work I could use UI scripting to hack this too... Sigh)



[ Reply to This | # ]
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 | # ]
10.3: Record Finder actions in Script Editor
Authored by: rspress on Oct 30, '03 03:04:34PM

It must be more solid all the way around. I had some AppleScripts that used Apples Text to Speech to announce the name of some of my friends when they email me. It uses a mail.app rule but it never worked under Jaguar( I could never figure out why it didn't work). The big surprise with panther, besides its great increase in speed and graphic glitz was that mail.app is now speaking those AppleScripts!



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: masskinner on Oct 31, '03 09:16:59AM

One of the first things I tried with Panther was to record Finder actions. I hit the Record button, move icons around, open files, etc. Hit Stop. Nothing—no code. What am I doing wrong?



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

uh, masskinner, didn't you read all the previous comments.
I posted my two on the same subject before yours.



[ Reply to This | # ]
10.3: Record Finder actions in Script Editor
Authored by: masskinner on Nov 03, '03 08:21:43AM

Yes I did. Hence my posting this message at the very end of this thread. And now I'll answer my own question. The reason why I didn't see any recording activity from the Finder is because very few aspects of the Finder are recordable. Switching apps does nothing. Moving icons does nothing. Showing the clipboard does nothing. Et cetera, et cetera. I finally managed to see some activity when I moved a window. For my purposes, recording is useless...



[ Reply to This | # ]