Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Search for AppleScript content in Spotlight' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Search for AppleScript content in Spotlight
Authored by: mark hunte on Jun 15, '05 02:29:28PM
Emm... The link does seem to be down ??

Here is the Hopefully improved version.

( this one does not need to open the info window.. to put the comment in.,
I discoved that I could do this with set comment (which did not work before for me
as I had it in a Process application tell block instead of a normal one.,
Dougs Script in Robg's, hint showed me the way. http://www.macosxhints.com/article.php?story=20050614071122965)

 (* This script will open any selected scripts  and copy 
the contents, and paste them into the info window of the script file, the 
content can be found in spotlight

*)
property flag : ""
tell application "Finder"
	set SiTem to selection
	
	repeat with i from 1 to number of items in SiTem
		set this_item to item i of SiTem --as string
		
		tell application "System Events"
			tell process "finder"
				open this_item
				delay 1
				keystroke "a" using [command down]
				keystroke "c" using [command down]
				delay 1
				--keystroke "b" using [command down, control down] -- sticky brain grab
				my setComm(this_item, flag)
			end tell
		end tell
	end repeat
end tell

on setComm(this_item, flag)
	tell application "Finder"
		
		set comment of this_item to the clipboard
		
		tell application "Script Editor"
			close window of document 1
		end tell
		
	end tell
end setComm
Both scripts work ok.

---
mh

[ Reply to This | # ]