Creating To Dos from Redmine in Things

January 5th, 2010 by Markus Leave a reply »

I just have had to create a dozen of To Dos in Things based on Redmine Issues. Being lazy I thougth I could spend an hour better in coding than in typing new To Dos, so here it is:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# v2010010402

tell application "Firefox"
        # set myFirefox to properties of front window as list
        # set theTitle to «class pTit» of front window as text
        set theTitle to name of front window
        # Calling display ... within tell application "Firefox" leads to error
        # -1728 every time you call the script again till firefox is really
        # closed, so save the vars and end tell
end tell

if (length of theTitle < 2) then
        display alert "Could not get the title (empty)"
else
        # save previous delimiters
        set tid to AppleScript's text item delimiters
        set AppleScript's text item delimiters to "#"
        set theSubstring to (text item 2 of theTitle) as text
        set AppleScript's text item delimiters to " - Issue Tracker xyz"
        set theName to "#" & (text item 1 of theSubstring) as text
        # restore delimiters
        set AppleScript's text item delimiters to tid

        tell application "Things"
                set newToDo to make new to do with properties {name:theName}
        end tell

        tell application "GrowlHelperApp"
                set the allNotificationsList to {"Task Created"}
                set the enabledNotificationsList to {"Task Created"}
                register as application ¬
                        "Create Task from Multiple Mail (Growl Enabled)" all notifications allNotificationsList ¬
                        default notifications enabledNotificationsList ¬
                        icon of application "Things"
                notify with name ¬
                        "Task Created" title ¬
                        "Task created in Things" description ¬
                        theName application name "Create Task from Multiple Mail (Growl Enabled)"
        end tell
end if
Advertisement

Comments are closed.