Use Dropbox to Create a Yojimbo iPhone App

October 1, 2009

Yesterday I read that DropBox announced their new iPhone app, and it occurred to me that you could set up the Dropbox iPhone app to clip images directly into Yojimbo with very minimal effort.  I was so pumped.  This was a total game changer.

Here’s how to do it:

(Note:  I’m assuming that you have Yojimbo installed on your Mac and Dropbox installed on both your iPhone and Mac.  If not, download Dropbox here and Yojimbo here.)

  1. On your Mac, create a new folder called “Clip to Yojimbo” in your Dropbox folder:

Clip to Yojimbo Folder in Dropbox

  1.  Copy and past the below code into Script Editor.  This will become a folder action that runs anytime a file is added to the “Clip to Yojimbo” folder (note: you will have to enable folder actions if they are not already set up).  Save the script to your Mac’s Library/Scripts/Folder Actions folder as “import to Yojimbo” or whatever name you like.
on adding folder items to this_folder after receiving these_items
    repeat with x from 1 to the count of these_items
        set theFile to item x of these_items
        try
            tell application "Yojimbo"
                import theFile
            end tell
        end try
    end repeat
end adding folder items to

Note for Scripters:  You can certainly get a little fancier with the Applescript, i.e. move the picture to an archive folder after the import is complete, etc. but this is all you need to get the basic import done.

  1.  Assign the “import to Yojimbo” folder action to the “Clip to Yojimbo” folder.

Assign Yojimbo Folder Action

  1. That’s it.  Now it is time to test it out.  Go to your iPhone, go to DropBox and navigate to the “Clip to Yojimbo” folder. Take a picture.

Clip A Photo With Dropbox on the iPhone

  1. If you are at your Mac, you will see the picture almost immediately show up in the Dropbox folder.

Clip to Yojimbo Folder with New Items

  1.  A couple seconds later, it will import right into Yojimbo.

Succesful File Import into Yojimbo

You’re done.  Pretty cool, right?  You can watch the whole process happen in real time on your Mac if you have the Finder open to the “Clip to Yojimbo” folder alongside an open Yojimbo window.  It is almost instantaneous.  The lack of an iPhone app for Yojimbo was the reason I started using Evernote, so this is pretty exciting.   It probably just swung my decision pendulum back to using Yojimbo.

  • Chris H.

    Sure it’s great, but it doesn’t do you a darned bit of good for reading existing Yojimbo data on your iphone. Which is what I would want to do 98% of the time.

  • http://www.samlevin.com Sam

    Ken, cool.. yet for non nerds this needs to be baked into one installer. Yes, I’m a nerd yet one that does not have time to deal with scripts.. thanks for your supreme nerdness nonetheless!

  • Torch

    I assume that this could also work with other databases, such as DevonThink or FileMaker. Is that true?

  • http://chembob.wordpress.com ChemBob

    Torch, I too would be very interested in knowing whether this would work with DEVONthink, which I know is scriptable. However, like Sam, I’m a nerd with insufficient nerding time. Ken, would this work?

  • Ken Clark

    Chris, I have been using Evernote on the iPhone and for me, I found that I “clipped” like crazy with the camera, but did most of my sorting out on the Mac, which is why this idea appealed to me. Maybe one way to make Yojimbo data accessible via the iPhone would be to write an Applescript to export Yojimbo data into folders named by tag on Dropbox and then you could view it on the iPhone. I know… that is really over the top, but just thinking out loud as I write this…

  • Ken Clark

    Thanks Sam. I am not sure if it could be automated the whole way through, but I will look into it. –Ken

  • Ken Clark

    I don’t use DevonThink or FileMaker, so I can’t answer 100%, but the basic premise is not Yojimbo-specific. What this process is doing is taking a file that was created on the iPhone and then saved to Dropbox in the cloud, and then “acting” on it via a folder action from your local Mac. I would say that as long as DevonThink and FileMaker support importing files via Applescript or Automator actions (and I have to imagine they do), it should work.

  • http://elasticthreads.tumblr.com/ elasticthreads

    should do the same for Evernote:

    property done_foldername : “Clip Successful” – if the clip fails, we’ll move files into here property failed_foldername : “Clip Failed” property enNotebook : “noteBox” on adding folder items to this_folder after receiving these_items try — iterate of files added repeat with i from 1 to number of items in these_items set this_item to item i of these_items

            set thepath to this_item as text
            set theposix to POSIX path of thepath
            set AppleScript's text item delimiters to "/"
            set theParent to (items 1 thru -2 of text items of theposix) as string
            set AppleScript's text item delimiters to ""
            set keyIndex to the (length of theParent) + 2
            set theName to (items keyIndex thru -1 of text items of theposix) as string
            tell application "Evernote"
                -- clip it!
                create note from file this_item title theName notebook enNotebook
            end tell
            tell application "Finder"
                -- make sure our 'success' destination folder exists
                if not (exists folder done_foldername of this_folder) then
                    make new folder at this_folder with properties {name:done_foldername}
                end if
                set done_folder to folder done_foldername of this_folder
                -- move the file we just clipped into our success folder
                move this_item to done_folder with replacing
                -- all done
            end tell
        end repeat
    on error e
        -- uh oh.  bad things happened.
        tell application "Finder"
            -- make sure our 'failed' folder exists
            if not (exists folder failed_foldername of this_folder) then
                make new folder at this_folder with properties {name:failed_foldername}
            end if
            set failed_folder to folder failed_foldername of this_folder
            -- move the failed file into the failed folder
            move this_item to failed_folder with replacing
            -- display the error message
            display dialog e buttons {"Cancel"} default button 1 giving up after 120
        end tell
    end try
    

    end adding folder items to

  • http://blog.icultur.com/2009/10/01/use-dropbox-iphone-app-to-automatically-import-photos-into-yojimbo/ Use Dropbox iPhone App to Automatically Import Photos Into Yojimbo «
  • http://typicalmacuser.com Victor Cajiao

    Ken if you don’t mind here is a link to how we used dropbox for the iPhone and automater to create folders that will post to Posterous automatically. This was done within hours of the app coming out.

    http://victorcajiao.posterous.com/how-we-upload-files-from-our-drop-box-folder

  • Ken Clark

    Very cool. It is pretty similar conceptually to the idea I described above. It is neat to see how all these apps can tie into the Mac’s automation tools. I’m a big fan of TMU, thanks for visiting! –Ken

  • http://claycarson.net/2009/10/03/use-dropbox-create-yojimbo-app/ | Clay Carson

    [...] Use Dropbox to Create a Yojimbo iPhone App Yesterday I read that Dropbox announced their new iPhone app, and it occurred to me that you could set up the Dropbox iPhone app to clip images directly into Yojimbo with very minimal effort. I was so pumped. This was a total game changer. ← Previous Post [...]

  • http://claycarson.net/2009/10/09/sync-yojimbo-notes-with-simplenote/ Sync Yojimbo Notes With SimpleNote | Clay Carson

    [...] after Dropbox released their iPhone app, this gem of a blog post was written explaining how to sync photos from your iPhone to Yojimbo using [...]

  • http://www.macstories.net/reviews/an-in-depth-look-at-yojimbo-hacks-applescripts-and-online-sync-services/ An In-Depth Look At Yojimbo: Hacks, Applescripts and Online Sync Services.

    [...] tip I’d like to share with you is how to create a Yojimbo iPhone app with Dropbox: it doesn’t require the database file, but it’s definitely worth a [...]

  • http://www.macstories.net/tutorials/40-creative-uses-for-dropbox-designers-and-mac-users-will-love/ 40 Creative Uses For Dropbox Designers and Mac Users Will Love

    [...] Use Dropbox to Create a Yojimbo iPhone App [...]

  • http://starttags.com/tags/ken-clark ken clark – StartTags.com

    [...] I embarked on what could best be described as a scouting combine for Mac-based newsreaders. …Use Dropbox to Create a Yojimbo iPhone App Ken Clarkby Ken Clark on October 1, 2009. Yesterday I read that DropBox announced their new iPhone app, and [...]

  • http://twitter.com/MaryShore Mary Hinkle Shore

    I'm always amazed when scripts work! This one worked flawlessly for me. Many Thanks.

  • http://robpickering.com/2010/06/automatically-add-pdf-files-to-ibooks-itunes-via-dropbox/ Automatically add PDF Files to iBooks / iTunes via Dropbox

    [...] got the idea to use Folder Actions with Dropbox from reading Ken Clark’s Blog Post: Use Dropbox to Create a Yojimbo iPhone App. In fact, I still use his ideas and scripts so my wife and I can have purchase receipts [...]

Previous post:

Next post: