The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Today's Posts

 
Adjusting of AppleScript to add project, context and start date Thread Tools Search this Thread Display Modes
Thanks Dale. Got it working...now how would I add a file with variable file_name as an attachment? Here's what I've got so far

tell application "Finder" to set file_name to (name of theFile)

tell application "OmniFocus"
set theTask to "Read " & file_name
set dueDate to (current date)
set time of dueDate to 0 + (16 * hours)
set startDate to (current date)
tell default document
set theContext to first flattened context where its name = "Device"
set theFolder to first flattened folder where its name = "Work"
set theProject to first flattened project of theFolder where its name = "Read"
tell theProject to make a new task with properties {name:theTask, context:theContext, due date:dueDate, start date:startDate, estimated minutes:"15"}
end tell
end tell
 
Sorry for such a late response. I have been in the new OmniFocus forum for OF2.

I am not sure if you are wanting a linked file or an embedded file.

I would suggest taking the script from Rob Trew in post 26 of this thread and modifying that script. You should be able to verify the current script variables are correct for you situation and add in the requirement in placing a task into a specific folder. I hope this helps.

You should also know the AppleScript library for OF2 has been changed and this can effect current scripts. I have not tested any scripts in OF2 and will probably not do so until it is officially released and determined if I am going to upgrade to the new version, continue using OF1, or moving to another solution.
 
 





All times are GMT -8. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.