The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniOutliner 3 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=9)
-   -   Using Applescript to Attach File (http://forums.omnigroup.com/showthread.php?t=3301)

BillB 2007-04-15 06:04 AM

Using Applescript to Attach File
 
Hi,
I'm trying to write an applescript to use as a Folder Action. When a file is moved into the folder, the script should (a) find the path to the file , (b) opens an OO document named 'DocRepository', and (c) add the file path as an Attached File. The idea is to keep an OO document with links to the files in the folder . The script I have so far sort of works, except that it creates an entry with the filename in text form. Can anybody suggest how to do this properly, so that the item that's created is an actual link to the file ?
Many thanks,
Bill

on adding folder items to this_folder after receiving these_items
repeat with myFile in these_items
set myFileText to (myFile as text)
tell application "OmniOutliner Professional"
tell document "DocRepository"
make new row with properties {topic:myFileText} at beginning of rows
end tell
end tell
end repeat
end adding folder items to

DerekM 2007-04-16 03:55 PM

Unfortunately there isn't AppleScript support for attachments right now. I have tried doing something like this myself and had varied results. You can get the path to the file and paste that and rely on OO to convert it to a link, however, it can't deal with spaces in the path. So, short answer, it's not possible right now.


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

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