Page 1 of 1

Using inputAttributes in AppleScript with Things.app?

PostPosted: Tue Feb 10, 2015 3:21 am
by gcoghill
I have the following AppleScript working to add a new to-do to Things.app:

Code: Select all
tell application "Things"
   set newToDo to make new to do with properties {name:"Add project start date to database!", due date:current date} at beginning of list "Today"
   set area of newToDo to area "Work/Biz"
end tell


However, I would like for it to pick up the project name, so I added a custom token ("Project Name") so as to be able to grab the folder name and use it in the AppleScript using the "inputAttributes" feature (although I am not sure exactly who to use this feature). See below where I would like for this to be inserted into the AppleScript (placed as **inputAttributes** in the spot where I want the name to be inserted):

Code: Select all
tell application "Things"
   set newToDo to make new to do with properties {name:"Add **inputAttributes** project start date to database!", due date:current date} at beginning of list "Today"
   set area of newToDo to area "Work/Biz"
end tell

Re: Using inputAttributes in AppleScript with Things.app?

PostPosted: Tue Feb 10, 2015 12:35 pm
by Mr_Noodle
inputAttributes is a list so you need to refer to specific items in it. Check out this article: http://en.wikibooks.org/wiki/AppleScrip ... nd_records

Also, not sure if you did this or not, but in the UI, you need to tell Hazel to send in "Project Name" to the script as an input attribute.

Re: Using inputAttributes in AppleScript with Things.app?

PostPosted: Wed Feb 11, 2015 12:42 am
by gcoghill
Ah, I guess I should have dug into the documentation before posting here. The is above my pay grade.

I did discover the Input Attribute in the UI.

And when looking over the help files. I found this error:

Input Attributes
Scripts take in a list of input attribute values as its second argument.

To specify these attributes, click on the Info button: in the AppleScript condition or action.

There, on the left side, you can specify which attributes to pass into your script.


It is on the right side.

Thanks for the help.

Re: Using inputAttributes in AppleScript with Things.app?

PostPosted: Wed Feb 11, 2015 11:50 am
by Mr_Noodle
Err, whoops. Will fix that in the next release.