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 05:02:51PM
Ok just used the unicode text, and that makes the script much,Oh my god faster, Thanks again.
 (* 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 the_script_text : ""
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 "Script Editor"
			open this_item
			tell document 1
				set the_script_text to contents as Unicode text 				close
			end tell
			--keystroke "b" using [command down, control down] -- sticky brain grab
			my setComm(this_item, the_script_text)
		end tell
		
	end repeat
end tell

on setComm(this_item, the_script_text)
	tell application "Finder"
		set comment of this_item to the_script_text
	end tell
end setComm
 

---
mh

[ Reply to This | # ]

Edit to above comment.
Authored by: mark hunte on Jun 15, '05 05:08:51PM

Make sure the 'close' is on the line below ' set the_script_text to contents as Unicode text '
like this

set the_script_text to contents as Unicode text
close

---
mh



[ Reply to This | # ]