Tuesday, December 25, 2018

Import a list into Wunderlist - MacOS

I was bored on Christmas day and thought I ll read the wiki pages of all the 195 countries in the world. To keep track of the progress, I wanted to create a list of them in my favorite task-app Wunderlist.

A simple search got me the list, but now the problem is to import them into Wunderlist. Being on MacOS, it took me sometime to understand how apple-script + automator work, but at the end, it was trivial.
1. Goto Automator - New - Workflow 2. Add an AppleScript and paste the following
set U to {"Algeria", ... "Zimbabwe"}

repeat with i from 1 to number of items in U
    set X to (item i of U) as text

    tell application "Wunderlist"
        tell application "System Events"
            delay 0.25
            keystroke "N" using command down
            delay 0.25
            keystroke (X)
            keystroke return
        end tell
    end tell

end repeat
The above script in Automator types out the list into the Wunderlist application. Quick and dirty but does the job.

Search This Blog