Using inputAttributes in AppleScript with Things.app?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

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
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

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.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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.
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Err, whoops. Will fix that in the next release.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support