A collection of Applescripts and actions for Quicksilver

273 views
Skip to first unread message

Sesquipedalian

unread,
May 29, 2008, 11:58:09 PM5/29/08
to Blacktree: Quicksilver
This thread is for posting user made actions and Applescripts for
Quicksilver.

Please provide a brief description of what your script does, where to
save the script, how to use it, and finally the script code to be
pasted into Script Editor.

Thanks for sharing!

----------------------------


DO NOT POST HELP REQUESTS HERE.
Any posts besides completed Applescripts and actions will be removed.
If you need help, start a new discussion thread.
Message has been deleted

Sesquipedalian

unread,
May 30, 2008, 12:09:08 AM5/30/08
to Blacktree: Quicksilver
Description: Adds To Do items to the specified calendar. This is
intended as a workaround until someone fixes the iCal plugin to work
with OS X 10.5.

Where to save: ~/Library/Application Support/Quicksilver/Actions. The
saved script must be named "Create iCal To-Do in <Calendar
Name>.scpt", where <Calendar Name> is the name of the calendar to
which the To Do items are to be added.

Usage:
The following script makes to do items from text data in the form "get
milk due: Wed 4:15 pm priority: low"

Setting the due date is optional. The due date can take various
forms, including "May 20", "May 20, 2008", "20 may 08", "5/20/08" or
using the full or abbreviated name of the weekday. Weekday names are
always understood to indicate the first one with that name after
today. So if one were to enter the text above on a Wednesday, the
action would make the to do item due on the following Wednesday. If
it were entered on a Tuesday, the to do item would be due the next
day.

Setting the time due is a further option with the due date. 1pm,
10:30am, and 4:15 pm are all valid formats for the time. Times must
include "am" or "pm" or the action will fail. If a time due is not
specified, the event will be due at 12:00 AM on the date due. If a
time due is given, but no date due is given, it is assumed that the to
do item is due today at that time.

Setting the priority is also optional. Priority may be "high",
"medium" or "med", or "low". If no priority is specified, the to do
will be given a priority of none.

Code:

using terms from application "Quicksilver"
on process text inputText

set theCalendar to name of (info for (path to me))
set theCalendar to findReplace(".scpt", "", theCalendar)
set theCalendar to findReplace("Create iCal To-Do in ", "",
theCalendar)

set dueDate to ""
set pty to ""

set inputText to findReplace(" due:", "||due|", inputText)
set inputText to findReplace(" due ", "||due|", inputText)
set inputText to findReplace(" priority:", "||priority|", inputText)
set inputText to findReplace(" priority ", "||priority|", inputText)

set inputText to delimitText("||", inputText)

repeat with i from 1 to number of items in inputText
if item i of inputText contains "due|" then
set dueDate to item i of inputText
set item i of inputText to ""
else if item i of inputText contains "priority|" then
set pty to item i of inputText
set item i of inputText to ""
end if
end repeat

set inputText to (inputText as text)

try
set dueDate to findReplace("due|", "", dueDate)
set dueDate to getdate(dueDate)
end try
try
set pty to findReplace("priority|", "", pty)
end try

tell application "iCal"

ignoring case, hyphens, punctuation and white space
if pty is "high" then
set pty to high priority
else if pty is "medium" or "med" then
set pty to medium priority
else if pty is "low" then
set pty to low priority
else
set pty to no priority
end if
end ignoring

if dueDate is not "" then
set propertyList to {summary:inputText, due date:dueDate,
priority:pty}
else
set propertyList to {summary:inputText, priority:pty}
end if

make new todo with properties propertyList at end of todos in
calendar theCalendar

end tell
end process text
end using terms from

----------

on findReplace(findText, replaceText, sourceText)
set ASTID to ""
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
set AppleScript's text item delimiters to ASTID
return sourceText
end findReplace

on delimitText(delim, sourceText)
set ASTID to ""
set AppleScript's text item delimiters to delim
set sourceText to text items of sourceText
set AppleScript's text item delimiters to ASTID
return sourceText
end delimitText

on getdate(thedatetext)

if "am" is in thedatetext or "pm" is in thedatetext then
set thedatetext to findReplace(" am", "am", thedatetext)
set thedatetext to findReplace(" pm", "pm", thedatetext)
set thedatetext to delimitText(" ", thedatetext)
set thetimetext to last item of thedatetext
set thetimetext to time string of (date thetimetext)
set the last item of the thedatetext to ""
set thedatetext to thedatetext as text
end if

set thedaysoftheweek to {"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"}
ignoring case, punctuation and white space
if thedatetext is in (thedaysoftheweek as text) then
repeat with i from 1 to 7
if thedatetext is in item i of thedaysoftheweek then
set thedatetext to item i of thedaysoftheweek
exit repeat
end if
end repeat

set theDate to
DateOfThisInstanceOfThisWeekdayBeforeOrAfterThisDate(current date,
thedatetext, 1)
else
set theDate to (date thedatetext)
end if
set thedatetext to date string of theDate & " " & thetimetext
set theDate to (date thedatetext)
end ignoring
return theDate
end getdate

on DateOfThisInstanceOfThisWeekdayBeforeOrAfterThisDate(d, w, i) --
returns a date
-- Keep an note of whether the instance value *starts* as zero
set instanceIsZero to (i is 0)
-- Increment negative instances to compensate for the following
subtraction loop
if i < 0 and d's weekday is not w then set i to i + 1
-- Subtract a day at a time until the required weekday is reached
repeat until d's weekday as text is w
set d to d - days
-- Increment an original zero instance to 1 if subtracting from
Sunday into Saturday
if instanceIsZero and d's weekday is Saturday then set i to 1
end repeat
-- Add (adjusted instance) * weeks to the date just obtained and zero
the time
d + i * weeks - (d's time)
end DateOfThisInstanceOfThisWeekdayBeforeOrAfterThisDate

Sesquipedalian

unread,
May 30, 2008, 12:19:57 AM5/30/08
to Blacktree: Quicksilver
Description: Inserts the current date at the insertion point.

Where to save: ~/Library/Scripts

Usage: Just run it.

Code:

tell application "System Events" to keystroke date string of (current
date)

On May 29, 11:58 pm, Sesquipedalian <jonstov...@gmail.com> wrote:

Sesquipedalian

unread,
May 30, 2008, 12:27:15 AM5/30/08
to Blacktree: Quicksilver
Description: Fast User Switch to a specified account. This is
intended as a workaround until someone fixes the User Accounts module.

Where to save: ~/Library/Scripts

Usage: You will need a copy for each user on your machine. Modify
the 502 to the appropriate user id number for each user. In general,
the first user created on your Mac has the uid 501, the second is 502,
etc. Save each copy as something like "Switch to <username>.scpt",
where <username> is the name of the user you want to switch to. If you
want to get fancy, you can copy the appropriate user picture from the
Accounts preference pane and paste it onto the icon in the Get Info
window of the script. Then you will get the user icon in QS's first
pane instead of a generic Applescript icon.

Code:

do shell script "/System/Library/CoreServices/'Menu Extras'/
User.menu/
Contents/Resources/CGSession -switchToUserID 502"

On May 29, 11:58 pm, Sesquipedalian <jonstov...@gmail.com> wrote:
Message has been deleted
Message has been deleted

Patrick

unread,
Jun 3, 2008, 12:46:30 PM6/3/08
to Blacktree: Quicksilver
Updated 'Show Character Palette' Script (used after enabling the
'extra scripts' plugin)

Working with Mac OS 10.5

Copy the following code between the two starred-*** lines into Script
Editor
Note: Google Groups seems to have problems with line breaks. Mac sure
the line beginning ' set proc_ to "/System/Li..... ' up to ' /
CharPaletteServer" ' is all on ONE line in the Script Editor

****************************
set app_ to "CharPaletteServer"
set proc_ to "/System/Library/Components/CharacterPalette.component/
Contents/SharedSupport/CharPaletteServer.app/Contents/MacOS/
CharPaletteServer"

try
do shell script "ps -axwww | grep" & space & proc_ & space & "| grep -
v grep"
tell application app_ to quit
on error
do shell script proc_ & space & "> /dev/null 2>&1 &"
end try

******************************

Save the file in ~/Library/Application
Support/Quicksilver/Plugins/Extra Scripts.qsplugin/Contents/Resources/
ExtraScripts/Miscellaneous/

- replacing the old one.

Script taken from http://www.macosxhints.com/article.php?story=20080326102502259
if copying the above script doesn't work, try taking it from the link
above.

Hagure

unread,
Jun 4, 2008, 4:36:18 PM6/4/08
to Blacktree: Quicksilver
Description: Takes inputted text from the first pane and uses it to
display a growl notice (the first one is a regular growl, the second
one is a sticky one). The regular one can be used as a supplement to
"Large Type", and the sticky one is useful for a quick, temporary (and
easily dismissible) notepad (helpful when displaying a phone number or
address).

Note: I don't take credit for writing these, they were on the old
forums in the "good ol' days".

Where to save: Actions folder i.e. ~/Library/Application%20Support/
Quicksilver/Actions/

Script (Display Growl):

using terms from application "Quicksilver"
on process text theText
growl(theText)
end process text
end using terms from

on growl(theText)
tell application "GrowlHelperApp"
set the allNotificationsList to {"Quicksilver Growl"}
set the enabledNotificationsList to allNotificationsList

register as application ¬
"Quicksilver Growl" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "iTunes"

-- Send a Notification...
notify with name ¬
"Quicksilver Growl" title ¬
"a quick note:" description ¬
theText application name ¬
"Quicksilver Growl" icon of application ¬
"Quicksilver"
end tell
end growl

********************** End of Display Growl Script (copy up to "end
growl") ****************

Script (Display Growl Sticky):


using terms from application "Quicksilver"
on process text theText
growlStick(theText)
end process text
end using terms from

on growlStick(theText)
tell application "GrowlHelperApp"
set the allNotificationsList to {"Quicksilver Growl"}
set the enabledNotificationsList to allNotificationsList

register as application ¬
"Quicksilver Growl" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Quicksilver"

-- Send a Notification...
notify with name ¬
"Quicksilver Growl" title ¬
"a quick note:" description ¬
theText application name ¬
"Quicksilver Growl" with sticky
end tell
end growlStick

********************** End of Display Growl Script Sticky (copy up to
"end growlStick") ****************

Hagure

unread,
Jun 4, 2008, 4:41:50 PM6/4/08
to Blacktree: Quicksilver
Description:
A script to quickly search files and folders using Quicksilver [1] and
EasyFind [2].
Written by Simon Dorfman, January 8, 2006. www.SimonDorfman.com

[1] http://www.versiontracker.com/dyn/moreinfo/macosx/22549
[2] http://www.versiontracker.com/dyn/moreinfo/macosx/11706

Note: again, another script from the old forums, not written by
myself. EasyFind is an "oldschool" searching program, similar to the
pre-OSX "Find" command (aka NOT Spotlight)

Where to save: Actions folder i.e. Save this script to ~/Library/
Application Support/Quicksilver/Actions/EasyFind.scpt

Usage: You'll need to have "Enable access for assisstive devices"
enabled under Universal Access in System Preferences.
To use:
1. activate Quicksilver
2. type "." (i.e. hit the period key)
3. type the text you want to search for (i.e. httpd.conf)
4. press tab
5. start typing "EasyFind.scpt"
6. once Quicksilver finds "EasyFind.scpt", press return

Script: (copy from " (* " until "end using terms from")

(*
A script to quickly search files and folders using Quicksilver [1] and
EasyFind [2].
Written by Simon Dorfman, January 8, 2006. www.SimonDorfman.com

Save this script to ~/Library/Application Support/Quicksilver/Actions/
EasyFind.scpt
You'll need to have "Enable access for assisstive devices" enabled
under Universal Access in System Preferences.
To use:
1. activate Quicksilver
2. type "." (i.e. hit the period key)
3. type the text you want to search for (i.e. httpd.conf)
4. press tab
5. start typing "EasyFind.scpt"
6. once Quicksilver finds "EasyFind.scpt", press return

[1] http://www.versiontracker.com/dyn/moreinfo/macosx/22549
[2] http://www.versiontracker.com/dyn/moreinfo/macosx/11706
*)

using terms from application "Quicksilver 55"
on process text t
tell application "EasyFind" to activate
tell application "System Events"
tell process "EasyFind"
set value of text field 1 of window 1 to t --type text in search
field
--uncomment your preferred search option, or save separate scripts
with each option
click radio button 1 of radio group 1 of window 1 --"Files &
Folders"
--click radio button 2 of radio group 1 of window 1 --"Only Files"
--click radio button 3 of radio group 1 of window 1 --"Only
Folders"
--click radio button 4 of radio group 1 of window 1 --"File
Contents"
click button 4 of window 1 --start search
end tell
end tell

Sesquipedalian

unread,
Jun 16, 2008, 1:35:35 PM6/16/08
to Blacktree: Quicksilver
Descripton: View files in Leopard's Quicklook.

Where to save: ~/Library/Application Support/Quicksilver/Actions/
Quicklook.scpt

Usage: Select a file in Quicksilver, and then run this action. A
Finder window will open, revealing the file, and then Quicklook will
be invoked to show you a preview of the file.

Code:

on open these_items
tell application "Finder"
activate
select these_items
tell application "System Events" to key code 49
end tell
end open


----

This alternative version does not require a Finder window to open.
However, this method of using Quicklook is not as functional as when
used from Finder. So it is a tradeoff: a fully functional Quicklook
with a Finder window using the script above, or a partially functional
Quicklook without a Finder window using the script below.

Code:

on open these_items
set these_paths to ""
repeat with i from 1 to the count of these_items
set these_paths to these_paths & space & (the quoted form of the
POSIX path of (item i of these_items))
end repeat

do shell script "qlmanage -p " & these_paths & " &> /dev/null"

end open
Message has been deleted

yelly

unread,
Jun 23, 2008, 7:32:14 AM6/23/08
to Blacktree: Quicksilver
I've just uploaded a collection of iTunes scripts that enable growl
notifications (among others), you can download them all in the files
section (the folder also includes unedited default iTunes scripts). I
suggest replacing the scripts in ~/Library/Application Support/
Quicksilver/PlugIns/iTunes Module.qsplugin/Contents/Resources/Scripts
with the contents of the folder.
If anyone has any suggestion/additions to the scripts, I would be more
than glad to accommodate that. More icons would be especially welcome.

Brett Swift

unread,
Jun 26, 2013, 2:01:17 PM6/26/13
to blacktree-...@googlegroups.com
I just found this and would love to get it working, however I can't seem to..   I'm able to execute the script but it doesn't show a notification. 

I'm not familiar with how applications integrate with growl - I was expecting a quicksilver application to be registered in the growl application list - which isn't happening. 

In 5 years I assume something was upgrade.. does anyone know what needs to happen? 

Thanks! 

Jon Stovell

unread,
Jun 26, 2013, 8:33:23 PM6/26/13
to blacktree-...@googlegroups.com
Odds are that something got messed up when you copied and pasted the text into Script Editor. The old Google Groups liked to insert hard line breaks into messages, which would usually break the scripts people posted. If one of those snuck in somewhere, that could explain your issue.

Otherwise, you probably just don't have Growl running.

Hagure

unread,
Jun 28, 2013, 3:38:33 AM6/28/13
to blacktree-...@googlegroups.com
Also, these were written pre Lion & growl 2.0, so some things might be wonky. 

That said, I've just recently upgraded 10.6 → 10.8+growl 2.0, and have been fixing my applescripts as I notice errors. I'll (eventually) post my findings here, as well as a few new scripts I've made for various things.

Hagure

unread,
Jun 28, 2013, 3:43:53 AM6/28/13
to blacktree-...@googlegroups.com
Sorry for the double post, but I can confirm that The Growl Notification & Growl Sticky scripts still work as intended. Must be a formatting error.

I dunno if I posted my iTunes notification script here, but that definitely broke since 10.6/newer iTunes. I've fixed it with some code I found; I'll post it soon.

brett...@gmail.com

unread,
Jun 28, 2013, 8:51:55 AM6/28/13
to blacktree-...@googlegroups.com, blacktree-...@googlegroups.com
The growl script was looking for a GrowlHelperApp and wouldn't compile without it.   So the app selection window kept popping up and I just tried to see if I could point it at growl itself. 

No dice. 

And even worse - now whenever I compile the AppleScript it automatically changes the text in the file from GrowlHelperApp to growl!  

Do you know where the setting/file is that stores that information? 

The script compiles for me and even appears in quicksilver but when I send text to it - there's no notification and no new app registered in growl....  

Any tips to debug this?




Brett
Sent from my iPhone 

--
You received this message because you are subscribed to a topic in the Google Groups "Quicksilver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blacktree-quicksilver/8YLhO83tsPo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blacktree-quicks...@googlegroups.com.
To post to this group, send email to blacktree-...@googlegroups.com.
Visit this group at http://groups.google.com/group/blacktree-quicksilver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

1.61803

unread,
Jun 29, 2013, 8:15:28 AM6/29/13
to blacktree-...@googlegroups.com
On Friday, June 28, 2013 2:51:55 PM UTC+2, Brett Swift wrote:
The growl script was looking for a GrowlHelperApp and wouldn't compile without it.
 
Find All Applications (Catalog) → GrowlHelperApp ⇥ Get Absolute (POSIX) Path

I have a very old version of Growl still running in ML. Mine is at /Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app. Yours might be in Growl.app's bundle.

Any tips to debug this?

In AppleScript Editor leave e.g. these lines out

using terms from application "Quıcĸsıɩⅴεʀ"

on process text theText

end process text

end using terms from


and add

set theText to "something"


and run.

To check what's not working add at your discretion

do shell script "logger -t " & myTag & space & myMes

--

display dialog "my variable: " & myVar

--

return myVar


HTH

1.61803

unread,
Jun 29, 2013, 8:18:36 AM6/29/13
to blacktree-...@googlegroups.com
On Friday, May 30, 2008 5:58:09 AM UTC+2, Sesquipedalian wrote:
DO NOT POST HELP REQUESTS HERE. 
Any posts besides completed Applescripts and actions will be removed. 
If you need help, start a new discussion thread.

I've just noted this from Sesquipedalian.

Hagure

unread,
Jun 29, 2013, 6:56:48 PM6/29/13
to blacktree-...@googlegroups.com
I've added the script to the wiki. See the comments there, it might help with your problem.
To unsubscribe from this group and all its topics, send an email to blacktree-quicksilver+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages