The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniPlan General (http://forums.omnigroup.com/forumdisplay.php?f=37)
-   -   Linking or attaching documents (http://forums.omnigroup.com/showthread.php?t=2627)

connie 2007-01-18 10:15 AM

Linking or attaching documents
 
I hate to take up space with such a simple question, but ... how do I link to, attach or embed document files into Omniplan? I don't seem to be able to do it within task notes. thanks in advance.

Lizard 2007-01-18 01:53 PM

Sorry, that feature isn't there yet. We hope to implement it soonish, but I cannot make any guarantees.

In the meantime, you could add a custom data column listing the path to a file, and then write an AppleScript (which can be added to your toolbar) which looks at the custom data column and opens the file for you. A little clumsy, but will work if you need file attachments *now*.

connie 2007-01-18 03:31 PM

thanks for the quick reply. Does anyone have such a script? thanks!

Lizard 2007-01-18 05:07 PM

A really rough, unofficial script
 
SETUP:
Step 1: Add a custom data column to your OmniPlan task inspector called "File"
Step 2: Copy the script below into a text file, and call it something like "Open File.scpt"
Step 3: Put that script file into ~/Library/Scripts/Applications/OmniPlan
Step 4: Open the "Customize Toolbar" button in OmniPlan, and drag the script up into your toolbar somewhere.
Step 5: Add file paths to the File field of your tasks.
NOTE: This script has no error handling in it. If you don't type a path exactly right, when you go to open a file, you'll either get a vague message that Finder had an error, or the script will just do nothing. The script expects paths like "/Applications/OmniOutliner.app" or "/Volumes/Tiger/Users/myName/Desktop/example.pdf".

SCRIPT:
[CODE]tell application "OmniPlan"
set taskList to selected tasks of front window
repeat with t in taskList
set customData to custom data of t
set fileToOpen to (|File| of customData as POSIX file)
tell application "Finder"
open fileToOpen
end tell
end repeat

end tell[/CODE]

Now, when you want to actually open the file or folder associated with a task (or tasks), just select the task(s) and click the toolbar button.

Lizard 2007-01-18 05:08 PM

PS: Please feel free to post improvements to this script, especially error handling, or improved flexibility in path parsing.

pslade 2007-01-25 04:06 PM

Applescript documentation?
 
Is there any documentation on how to drive OmniPlan from AppleScript? I would like to automate some tasks and I am wondering how much functionality is exposed and where I can learn about how to script against it.

Thanks!

Lizard 2007-01-25 04:23 PM

Probably the easiest way to get started is to take a look at the OmniPlan AppleScript dictionary itself, either in Script Editor, ScriptDebugger, or some other AppleScript development app. We've integrated basic documentation right in there, rather than writing a whole separate document. If you launch Script Editor (in /Applications/AppleScript by default), it should show you a library window. If OmniPlan is on the list, just double-click it. Otherwise, click the '+' and browse to wherever you keep OmniPlan on your computer.

That'll give you a complete list of the currently available classes, their properties, etc., etc.


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

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