Action updated to use QS Web Searches.
Usage: select QS Web Search in first pane, change to text mode, add search
terms after a comma
Example: http://www.google.com/search?hl=en&q=***,søren kierkegaard
using terms from application "Quıcĸsıɩⅴεʀ"
on process text theURLs
TorConnection(10, 0.5)
if theURLs contains "," then ¬
set theURLs to theURLsToCSV(theURLs)
if (count of theURLs) is 2 and item 1 of theURLs contains "***" then ¬
set theURLs to theURLsToWebSearch(theURLs)
repeat with theURL in theURLs as list
if theURL does not start with "http" then set theURL to "http://" &
theURL
do shell script "open -b org.mozilla.torbrowser " & quoted form of
theURL
delay 0.1
end repeat
end process text
on get direct types
return {"NSStringPboardType", "Apple URL pasteboard type"}
end get direct types
end using terms from
on TorConnection(Attempts, HoldTime)
tell application "System Events"
if not ((every process whose bundle identifier is
"org.mozilla.torbrowser") exists) then
tell application id "org.mozilla.torbrowser" to launch
tell application "Quıcĸsıɩⅴεʀ" to show notification "Tor Browser"
image name ¬
"org.mozilla.torbrowser" text "Trying to connect" & return & "to
TOR network…"
repeat with i from 1 to Attempts
delay HoldTime
if (count of (windows whose visible is true and name is not "Tor
Status") of application "TorBrowser") > 0 then
exit repeat
else if i is Attempts then
tell me to do shell script "killall firefox"
tell application "Quıcĸsıɩⅴεʀ" to show notification "Tor Browser"
image name ¬
"org.mozilla.torbrowser" text "Connection failed" & return &
return & "Quitting…"
error number -128 -- User canceled
end if
end repeat
end if
end tell
end TorConnection
on theURLsToCSV(theURLs)
-- for multiple values use comma-separated text
-- comma trick doesn't work with text nor URLs #1727
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set theCSURLs to text items of theURLs
set AppleScript's text item delimiters to ASTID
return theCSURLs
end theURLsToCSV
on theURLsToWebSearch(theURLsAsWebSearch)
-- usage: select QS Web Search, change to text mode, add search terms
after a comma
-- example: http://www.google.com/search?hl=en&q=***,søren kierkegaard
set theSearchTerms to urlEncode(item 2 of theURLsAsWebSearch)
set QSWebSearchURL to item 1 of theURLsAsWebSearch
set theWebSearchURL to findReplace("***", theSearchTerms, QSWebSearchURL)
return theWebSearchURL
end theURLsToWebSearch
on urlEncode(theSearchTerms)
return do shell script "php -r 'echo urlencode(\"" & theSearchTerms &
"\");'"
end urlEncode
on findReplace(findText, replaceText, sourceText)
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to findText
set sourceText to text items of sourceText
set AppleScript's text item delimiters to replaceText
set sourceText to sourceText as text
set AppleScript's text item delimiters to ASTID
return sourceText
end findReplace
--
You received this message because you are subscribed to the Google Groups
"Quicksilver" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/blacktree-quicksilver.
For more options, visit https://groups.google.com/groups/opt_out.