Put the quoted form of POSIX paths into Script Editor

As a beginner learning the basics of do shell script in AppleScript, I'm finding that most of my file and folder names have spaces in them. As such, I have two choices when writing paths: either escape all the spaces as I type them, or use the AppleScript quoted form of POSIX path construct.Both methods still require significant typing and exact spelling, and I'm from the generation that didn't learn to type. To ease my discomfort, I wrote this script for use in Script Menu:tell application "Finder" set Itms to selection set als to Itms's item 1 as alias set aPath to quoted form of POSIX path of alsend telltell application "Script Editor" activate tell front document set contents of selection to aPath end tellend tellThe script takes the currently-selected file or folder in Finder, and puts its quoted form of POSIX path into Script Editor's front document at the insertion point (or replaces the selection if text is selected)...

published on Friday, the 29. August 2008, macosxhints

Remove VMs from Parallels VM startup list

If you end up with unused virtual machines in your Parallels startup list, you can get rid of them by removing aliases from your ~/Documents/.parallels-vm-dire​ctory folder.Choose the Finder's Go to Folder command under the Go menu, paste in the above path and go. In the folder, delete the VM aliases you don't want. You may want to also delete the actual VM data, or maybe just find out where it lives. To do so, right-click on a VM alias and choose Show Original or Get Info from the contextual menu. You'll be taken to, or shown the path to that VM's files. The handy thing about only having one VM in the list is it's selected automatically when you start Parallels.

published on Friday, the 22. August 2008, macosxhints

10.5: Avoid strange GUI behavior with certain aliases

The first time I open /users/shared using an alias, the folder comes up with a sidebar, even though I've repeatedly set it to turn off the sidebar. Strangely, the animation appears to be opening the folder twice. If I then close the folder and re-open it, it shows up without the sidebar, just as I've configured it in previous sessions. From then on, every time I open the alias, it comes up without the sidebar. But if I log out and back in, I get the strange first-time behavior again, with a double-animation and a sidebar. If I use the Finder's Go -> Go to Folder menu for the first access, I can get to the target folder without the double-animation and without the sidebar. But the first time I use the alias, it shows the double-animation and the sidebar, so it really appears to be related to the alias. (I've tried re-creating the alias and even tinkering with it's extended att...

published on Tuesday, the 12. August 2008, macosxhints

Create a permanent sidebar entry for networked folders

If you're anything like me, then you probably access files within folders within folders on removable media (i.e. external hard drives, Flash drives). It can become quite a hassle (with a trackpad, anyway) to open the the media device, select the folder, navigate, select another folder, navigate, and then select the desired file or folder.I tried adding my commonly-accessed (but time consuming to reach) external hard drive folder to the Finder's sidebar, but whenever I took my MacBook somewhere and the folder wasn't present, the sidebar alias disappeared.So my solution was to make a local alias of the removable folder, put it in my Documents (or any other local) folder, then drag the alias to the sidebar. Now I can eject removable media without losing my sidebar shortcut. [robg adds: I thought we had run something similar in the past, but I can't find it now -- so if this is a duplicate, please let me know. Also, if you use this hint, you should be awa...

published on Monday, the 21. July 2008, macosxhints

Apps: AliasKeys, Dejumble, Media Catalog

AliasKeys 1.2 ($15) can assign keystrokes to open files and folders. Any item that the Finder can open may be dragged to the list of AliasKeys and assigned a combination of keys, to open it without touching mouse. It can be used for applications, documents, folders, aliases, preference panels, servers, scripts, Internet bookmarks, and more. The fre...

published on Thursday, the 15. May 2008, macintosh-news-network

10.5: Show file in Finder from the Open dialog box

I found this by accident while trying to find a target for a broken alias. While browsing the file system in an File » Open dialog box, pressing Command-R will open (and bring to the front) a new Finder window showing the chosen item's folder in the Finder. Note that you must have a file or folder selected in the dialog box for this to work. Curiously, the File » Save dialog box also tries to perform this behavior, but only switches to the Finder without the desired folder appearing in a new window. Presumably this is because you cannot select a file in the Save dialog box.

published on Monday, the 21. April 2008, macosxhints

Make iMovie '08 find movies on other drives

Having eventually found time to play around with the new-look iMovie, I was infuriated by the apparent difficulty in importing movies and seeing already-created iMovie projects -- I kept getting an error code -120 whenever I attempted to import movies. Following the problem through, I discovered that iMovie will not follow aliases to an external Movies folder; I have an alias in my home directory which points to a FireWire disk. After several minutes declaring the new software "useless junk," it occurred to me to replace the alias with a UNIX soft link (ln -s). Hey presto! All my movies appear in the Project section, and I can now import clips at will. And the best bit? As far as the Finder is concerned, there's no difference at all.

published on Monday, the 11. February 2008, macosxhints

Open a copy of the current Finder window via AppleScript

Sometimes I find myself needing to open a second copy of the current Finder window I have open. There's no default way to do this in Mac OS X, so I wrote a small script to take care of it for me: try tell application "Finder" activate set this_folder to (the target of the front window) as alias set {x1, y1} to position of front window make new Finder window to this_folder set position of front window to {(x1 + 50), (y1 + 150)} --This offsets the new window more than the average Finder tiling does end tell end try I use Butler to assign this a hot key, which then opens these copies when I need them. [robg adds: This wor...

published on Friday, the 11. January 2008, macosxhints

10.5: Call Automator workflows from AppleScript

Calling Automator workflows from AppleScript has been covered here before for 10.4. However, that tip doesn't work in Leopard.To execute an Automator workflow from an AppleScript in Leopard, first save the workflow as an application, then write a script like this:set lf to path to library folder from user domaintell application "Finder" to open (alias (lf & "Scripts:foo.app:" as text))[robg adds: I haven't tested this one.]

published on Thursday, the 6. December 2007, macosxhints

10.5: Use the Get Info window's proxy icon

Leopard's Finder Get Info panel now has a proxy icon on the panel's title bar. It can be dragged like the proxy icon in a Finder window title bar, and behaves in the same manner. Dragging while holding Option-Command will create an alias. Dragging while holding Option will copy the file if the destination is on the same volume. Just dragging to a destination on the same volume will move the file. [robg adds: You can also Control- or Command-click on the proxy icon to see the path to the chosen item. Select a spot in the path, and the Finder will open a new window showing that directory.]

published on Wednesday, the 28. November 2007, macosxhints