How do I use AppleScript to reveal a file in Finder from its POSIX path? I'm trying to create an AppleScript snippet that locates the current random wallpaper and reveals it in Finder. I have the following snippet which finds the current wallpaper's POSIX path as a string:

set plistFolderPath to path to preferences folder from user domain as string
set plistPath to plistFolderPath &amp; "com.apple.desktop.plist"
tell application "System Events"
    tell property list file plistPath
        tell contents
            set thePath to value of property list item "NewChangePath" of property list item "default" of property list item "Background" &amp; "/" &amp; value of property list item "LastName" of property list item "default" of property list item "Background"
        end tell
    end tell
end tell


thePath is now a string in the form:


  /Volumes/Archive/Widescreen wallpaper/12345_Name_2560x1440.jpg


(Note spaces)

I try to reveal this path in FInder, but everything I've tried results in an error:

tell application "Finder"
    reveal POSIX file of quoted form of thePath (* Error: "Can't get POSIX file of (blah)" *)
end tell


How do I reveal a pathname in Finder in AppleScript when all I have is its POSIX path?
I think your problem is that quoted form. Try something like this:

set thePath to POSIX file "/Volumes/Lion HD/Users/ngreenst/Desktop/image.jpg"
tell application "Finder" to reveal thePath


So, just reveal thePath