Applescripting file attachments

James Spahr james at spahr.org
Wed Feb 22 10:29:57 PST 2006


Doh!

Of course I would figure this out minutes after I sent an email to the 
list:

set f to alias "MacHD:Users:james:foo:bar.pdf"

set pf to POSIX path of f
set pf to change " " in pf into "%20"   -- Requires Satimage Text Util
set pf to "file://" & pf as string


tell application "OmniOutliner"
	set the_current_row to selected row 1 of document 1
	set new_row to make new row at the end of (children of the_current_row)
	set topic of new_row to pf
	
end tell



On Feb 22, 2006, at 1:20 PM, James Spahr wrote:

>
> Is it possible to do? This is what I'm trying:
>
> --
>
> set f to alias "MacHD:Users:james:foo:bar.pdf"
>
> tell application "OmniOutliner"
> 	set the_current_row to selected row 1 of document 1
> 	set new_row to make new row at the end of (children of 
> the_current_row)
> 	make new text attachment at end of topic of new_row with properties 
> {file name:f}
> end tell
>
> --
>
> I get an error when I try to make the attachment. I also tried the 
> 'add' command without any luck.
>



More information about the OmniOutliner-Users mailing list