Jump to content

LMGTFY Let Me Google That For You


Recommended Posts

Had a script with Alfred V1 but can't bring it to work with V2.

Somebody talented?  ^_^

 

http://d.pr/f/4BH6

 

--- SCRIPT BEGINS HERE ---


on alfred_script(q)
	try
		set the clipboard to (do shell script "curl " & quoted form of ("http://tinyurl.com/api-create.php?url=" & (do shell script "perl -e 'use URI::Escape; print uri_escape(\"" & "http://lmgtfy.com/?q=" & q & "\")';")))
		Growl("LMGTFY Link Copied", "Your victim awaits.", "LMGTFY", "Alfred")
	on error ErrorMessage number ErrorNumber
		if ErrorNumber is 6 then
			Growl("LMGTFY Error", "Could not connect to the internet.", "LMGTFY", "Alfred")
		else
			Growl("LMGTFY Error " & ErrorNumber, ErrorMessage, "LMGTFY", "Alfred")
		end if
		--if (do shell script "defaults read com.zibity.donate nonsence &") = "yes" then do shell script "afplay /Users/Sebastian/Desktop/nonsencenonsencenonsence.mp3 &"
	end try
end alfred_script
on Growl(tit, desc, iden, icon)
	tell application "Growl" to notify with name "Extension Output" title tit description desc application name "Alfred" identifier iden image from location "~/Library/Application Support/Alfred/extensions/applescripts/LMGTFY/icon.png"
end Growl

 

 

Link to comment

Had a script with Alfred V1 but can't bring it to work with V2.

Somebody talented?  ^_^

 

http://d.pr/f/4BH6

 

--- SCRIPT BEGINS HERE ---


on alfred_script(q)
	try
		set the clipboard to (do shell script "curl " & quoted form of ("http://tinyurl.com/api-create.php?url=" & (do shell script "perl -e 'use URI::Escape; print uri_escape(\"" & "http://lmgtfy.com/?q=" & q & "\")';")))
		Growl("LMGTFY Link Copied", "Your victim awaits.", "LMGTFY", "Alfred")
	on error ErrorMessage number ErrorNumber
		if ErrorNumber is 6 then
			Growl("LMGTFY Error", "Could not connect to the internet.", "LMGTFY", "Alfred")
		else
			Growl("LMGTFY Error " & ErrorNumber, ErrorMessage, "LMGTFY", "Alfred")
		end if
		--if (do shell script "defaults read com.zibity.donate nonsence &") = "yes" then do shell script "afplay /Users/Sebastian/Desktop/nonsencenonsencenonsence.mp3 &"
	end try
end alfred_script
on Growl(tit, desc, iden, icon)
	tell application "Growl" to notify with name "Extension Output" title tit description desc application name "Alfred" identifier iden image from location "~/Library/Application Support/Alfred/extensions/applescripts/LMGTFY/icon.png"
end Growl

 

Sufficient? http://cloud.dferg.us/CqIL

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...