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 04:43:20PM

Thanks for the tip of " Unicode text " I did try ' set ...to contents...' but a had tried just as text.

For me there is no need to append to a Applescript comment, if I run my script on it, I want the whole lot replaced because thats reflects whats in the file, and not bits I may have taken out.

Also I like to run these type of script from hot keys.

I do like the checking for a script routine, but again for me there is no need as I only run this on Applescript.

But saying all that, I am sure your script will suit others just as well : )


---
mh



[ Reply to This | # ]
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 | # ]