Applescript Quick Tip

Sorry PC users, just disregard this post. Mac users, if you are like me, you are constantly amazed by the useful, powerful, and simple stuff your computer can do. I was trying to use Automator to to get Finder to sort by [name, kind, whatever]. It didn’t go well, and i decided to try the apple script route and search for how to write keystrokes into applescript. More on this, and how to do it after the jump.

I couldn’t find clear info on it anywhere, but did finally get a suggestion to scrap Automator and try using Script Editor, another useful app that comes w/ your Mac. I fired it up, clicked record and then did my keystrokes. I then clicked stop and here were the results:

tell application “Finder”
     clean up Finder window 1 by name
end tell

I then did a “save as” and selected “application bundle”. Don’t ask me why but “application bundle” was faster than “application” in the execution of the script. Anyway, there you have it try the simple solutions first. I got hung up on the fact that I was going to have to code this one and it turned out that solution was much less complicated than i was making it.

What was the purpose of this? I took the application bundle and put it in my Finder toolbar, so now I have the ability to sort by name with a single click. 

Filed Under Mac / Apple


Leave a Reply