On Oct 13, 2013, at 5:32 PM, Shane Stanley wrote:
On 14 Oct 2013, at 7:21 AM, Luther Fuller <
email@hidden> wrote:
Is there any way around the Finder's prohibition to changing the .savedsearch extension?
Use shell scripting:
do shell script ("mv " & quoted form of "/Users/shane/Desktop/Some Search.savedSearch" & " " & quoted form of "/Users/shane/Desktop/Some Search.plist")
Which prompted me to wonder if I could do this without a shell script. So, I did ...
Compile this as an application bundle. It will make a plist copy of a selected savedSearch file.
If the plist copy already exists, it will update the copy.
tell application "Finder"
set theSelection to get selection
if (count items of theSelection) ≠ 1 then return
set searchFile to (item 1 of theSelection) as alias
if (name extension of searchFile) is not "savedSearch" then return
set folderAlias to container of searchFile
set filename to name of searchFile
end tell
set AppleScript's text item delimiters to {"."}
text items of filename
set filename to (items 1 thru -2 of the result) as text
tell application "System Events" to set fileRecord to value of property list file (searchFile as text)
set newFilePath to (folderAlias as text) & filename
tell application "System Events"
make new property list item with properties {kind:record, value:fileRecord}
make new property list file with properties {contents:the result, name:newFilePath}
end tell
beep
delay 1
Now you can have hours of fun decoding Spotlight searches.