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

 
Folder action for automatically adding new files to OmniFocus Thread Tools Search this Thread Display Modes
A user emailed earlier in the week wondering if there was a way to automatically add bills that he was scanning as PDFs to OmniFocus as actions. He knew that he could have his scanning software place the PDFs in a particular folder, but wasn't sure how to get them into OmniFocus from there without too many clicks.

The answer I came up with is the attached Folder action script. It takes any files that are added to the folder and attaches them to individual actions in the quick entry window.

To use, extract the .scpt file from the .zip and place it in /Library/Scripts/Folder Action Scripts/. You can add the action to any folder by control-clicking that folder in the finder and choosing Services >Folder Actions Setup...

I am by no means an AppleScript expert so there may be some situations where the script fails, but in my testing here it works well. As always, your feedback is welcome
Attached Files
File Type: zip Add files as OmniFocus actions.scpt.zip (2.7 KB, 1418 views)
 
Quote:
Originally Posted by dave_m View Post
To use, extract the .scpt file from the .zip and place it in /Library/Scripts/Folder Action Scripts/.
Looks good.

I would probably tend to install it in
~/Library/Scripts/Folder Action Scripts
(where ~ is the user's home folder)
rather than
/Library/Scripts/Folder Action Scripts
(under the root, affecting all users)
 
I'm assuming it leaves the attached file in the folder with the folder action attached? Is that right?
 
Quote:
Originally Posted by kingsinger View Post
I'm assuming it leaves the attached file in the folder with the folder action attached? Is that right?
That's right, it doesn't do anything to the file, just opens the quick entry window and makes an action with the file embedded.
 
Quote:
Originally Posted by whpalmer4 View Post
That's right, it doesn't do anything to the file, just opens the quick entry window and makes an action with the file embedded.
What happens if you move the file later? Does OF put a copy of the file in its own directory somewhere that isn't affected by moving the file in the original folder? Or does the link adjust to the new location?
 
Note that I said "embedded" :-) It puts a copy of the file in the database, and you'll sync it all around, if you are syncing. If it is a file you are going to change, you need to proceed with caution or you will be burned sooner or later by not getting your changes back into the database copy. I don't recommend embedding files that you plan to edit unless you really understand how it all works. Safer to put it somewhere like MobileMe or Dropbox where you can edit it directly, and just have a link to the file (or even just the name). On the other hand, if it is a file you are only going to reference, not change, and the size isn't too large, you shouldn't have any trouble.

If you do embed a large file, note that you won't be truly rid of it until after all of your syncing devices have synced the change where you delete it and had an opportunity to compact the database (normally at least an hour later).

If you've linked a file instead of embedding it, if the file is no longer present at the same location, attempts to open it will get you a file chooser dialog along with a warning that the file cannot be located at the old path. If you navigate to the new location, the link in the db gets updated, or you can cancel and deal with it at some other time. If this behavior makes you think "hmm, maybe they just store the path to the file at the time I attached it" you would be 100% correct. A nice side effect of doing it this way is that if you've stored the file in a place that has the same path on any system you use (MobileMe, for example), you don't actually have to cart the payload around.
 
Hi

Thanks for the script. Does anyone have suggestions for an addition to the script that would close the quick entry window rather than leaving it open?

I've taken a look but so far it's beyond me.

Kevin
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export each object automatically as separate PNG files PipSqueak OmniGraffle General 1 2013-02-12 02:38 PM
Default to next action when adding a new action? ethant OmniFocus 1 for Mac 0 2010-10-06 01:55 PM
Where is my database saved? [A: the OmniFocus folder inside App Support folder] Michael Blake OmniFocus 1 for Mac 2 2009-08-10 02:08 PM
Action Groups Don't Get Marked as Done Automatically minato2 OmniFocus for iPhone 15 2008-11-25 12:39 PM
5.0 b Why are layers locked down automatically when editing 4.x files? dude OmniGraffle General 0 2008-01-23 06:29 PM


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


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