• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: savedsearch files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: savedsearch files


  • Subject: Re: savedsearch files
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 14 Oct 2013 10:28:34 -0500

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.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >savedsearch files (From: Luther Fuller <email@hidden>)
 >Re: savedsearch files (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: InDesign export slows to a crawl
  • Next by Date: RE: InDesign export slows to a crawl
  • Previous by thread: Re: savedsearch files
  • Next by thread: Re: savedsearch files
  • Index(es):
    • Date
    • Thread