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 Search Today's Posts Mark Forums Read

 
Applescript to attach documents Thread Tools Search this Thread Display Modes
Hallo,

I am currently switching from kGTD to OmniFocus. In my earlier setup I often attached files or folder as aliases to a specific project to get an easy access to project materials or reference files. In OOP such aliasas were displayed by a nice little button with the file/folder name as button text.

I know that files can be attached to OmniFocus, too. But the name of the file or folder is omitted and only the clickable icon is visible. This may be fine, but if you have several attachments with identical icons it may get confusing.

So I tried to write a small script to include an attachment and its filename to a note. I started to tell the note of a task (I just leave out the tell... end tell statements)

make new file attachment with properties {file name:myfile, embedded:false}

as mentioned in the Forum before. This works fine and appends the attachment at the end of the note. But I don't know how to attach the file name.

set myName to (myfile as string)
insert myName at after last paragraph

does not work, the text is not included, while

set myName to (myfile as string)
insert myName at before first paragraph


works fine although the text is now far away from the attached document.
Do I need some kind of "make new paragraph..." command?

Best wishes
Tom
 
Two points -

1. The fact that a line like:
Code:
insert "Some Text" at after last paragraph
raises no error but has no effect does look like a bug, and might usefully be reported.

2. An alternative which does seem to work is:
Code:
make new paragraph at end of paragraphs with data "Some new Text"

Last edited by RobTrew; 2008-01-20 at 09:25 AM..
 
Thanks, this solution works for me.
And as always with Applescript, the solution seems very simple (after someone shows it to you ;-) )

Best wishes
Tom
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to attach text documents? beru OmniOutliner 3 for Mac 1 2009-04-12 07:54 AM
Omnigraffle Pro, AppleScript, Two Documents, Record Results cykyc OmniGraffle General 0 2007-04-20 03:58 PM
Using Applescript to Attach File BillB OmniOutliner 3 for Mac 1 2007-04-16 03:55 PM
AppleScript to detect unsaved documents vocaro OmniOutliner 3 for Mac 0 2006-09-20 07:29 PM


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


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