The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   AppleScripting Omni Apps (http://forums.omnigroup.com/forumdisplay.php?f=46)
-   -   OF: Add an attachment to existing task? (http://forums.omnigroup.com/showthread.php?t=30211)

ctrl 2013-07-03 03:03 AM

OF: Add an attachment to existing task?
 
How do you add a file to an existing task?

I know how to create a new task with a new file attachment, but I couldn't find out how to attach it to a specific task.

The task I want do address is always the same (same name, same OF task id).


Thanks for any help.

This is a part of dave_m's script, modified by whpalmer4 ([url]http://forums.omnigroup.com/showthread.php?p=118770&mode=linear#post118770[/url]:
[CODE] tell front document

set NewTask to make new inbox task with properties {name:file_name}
tell the note of NewTask
make new file attachment with properties {file name:this_item, embedded:pEmbedFile}
end tell

end tell
[/CODE]

RobTrew 2013-07-03 11:35 PM

You should be able to get a reference to an existing task with something like:

[CODE]set oTask to task id "fGboNvQt1Pr"[/CODE]

and then

[CODE]
tell the note of oTask
...
end tell[/CODE]

ctrl 2013-07-04 01:49 AM

Rob,
thank you, your solution works. In my special case I just had to add "of front document".


How can I get a reference to an existing task [B]using its name[/B]?

[CODE]set myTaskName to name of task id "fGboNvQt1Pr" of front document[/CODE]
will get the name of my task correctly.



However, this code
[CODE]set oTask to task id of front document whose name contains "Task name for attachments"
[/CODE] won't give me the task id.

ctrl 2013-07-04 01:57 AM

I just found your post over here: [url]http://forums.omnigroup.com/showthread.php?t=20311[/url]

Problem solved.


All times are GMT -8. The time now is 08:03 PM.

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