• 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: Searching for scripts - One solution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Searching for scripts - One solution


  • Subject: Re: Searching for scripts - One solution
  • From: "koenig.yvan" <email@hidden>
  • Date: Mon, 28 Jan 2013 17:01:52 +0100


Le 13/06/2012 à 13:44, demski <email@hidden> a écrit :

Oh, and what I didn't want to forget:
I used and altered the "setComm"-Handler from mark hunte, found it somewhere in the worldwidewaiting on hints.macworld.com


Am 13.06.2012 um 13:39 schrieb demski:

Maybe you could find this useful:
tell application "AppleScript Editor"
set the_script_text to contents of document 1 as text
get properties of document 1 of window 1
save document 1
set thePath to get path of document 1
set existsPath to false
repeat while existsPath is false
set thePath to get path of document 1
try
set savePath to thePath
set existsPath to true
on error
set existsPath to false
end try
end repeat
my setComm((thePath), the_script_text)
end tell

on setComm(this_item, the_script_text)
tell application "Finder"
set comment of (alias (POSIX file this_item as Unicode text)) to the_script_text
end tell
end setComm

I use Spark to create an Applescript-Action for AppleScript-Editor, call it "Sichern" (German localization) choose <cmd-s> as keyboard-shortcut and from now on the AS-Text is written into the Comment of the File and gets therefor Spotlight-searchable.

hth
demski

Am 13.06.2012 um 10:50 schrieb demski:

Hi,
unfortunately neither I recall the source nor where to find it (just googled a bit)
but there was a nifty little script that I managed to be run instead of AppleScript Editor's save Command which saved the whole text of the AS to the Spotlight Comments of the .scpt File.
Therefor the Script text was fully searchable...
Unfortunately I lost this little helper during machine/system changes...
But maybe someone of you finds it before I make my own?

hth, demski


Hello

I retrieved this old message and tried to use it.
I have now a script named a_library.scpt whose Finder's comment is the text of the script.

As the creation of the comment is recent, I forced Sptolight to update its index accoring to the scheme described in : http://support.apple.com/kb/HT2409.

No luck. When I ask Spotlight for files embedding a string borrowed from the script, it doesn't retrieve the source file.

What am I doing wrongly ?

Yvan KOENIG (VALLAURIS, France) lundi 28 janvier 2013 16:59:55


 _______________________________________________
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

  • Prev by Date: Clickable links!
  • Next by Date: Opening and reading a text file
  • Previous by thread: Re: Clickable links!
  • Next by thread: Opening and reading a text file
  • Index(es):
    • Date
    • Thread