Help: Accessing Photo Booth files for Automation/Applescript

Discussion in 'Mac Programming' started by Pojken, Oct 4, 2012.

  1. Pojken macrumors newbie

    Joined:
    Oct 4, 2012
    #1
    Hello,

    I recently transitioned from Windows to Mac (retinaMBP/Mountain Lion). With Windows, I used JitBit and Photoshop to create a simple script to make a photobooth for a friend's wedding. I am trying to recreate that using Automator, but it is... a bit frustrating. The problem is...

    • Accessing the files: "Photo Booth Library" is a library where Photo Booth saves the folders. How do I access the package content files in it using Automator? It seems that Photo Booth will not save it to a folder, but a library.

    Here is the logic I am trying to follow:

    1. Take 4 photos in Photo Booth (Complete: Used this code with a 7 second pause in between. "Take Video Snapshot" produced a low quality icon-sized image.)
    2. Select all files and open them in Photoshop (Incomplete: I can't figure out how. I assume that once I can access them, I can use "Open Finder Items" )
    3. Process photos in a strip (Complete: I can run a Photoshop Action script to make it into a script to arrange them.)
    4. Print strip (Complete: )
    5. Move photos to a different directory and upload to Dropbox (Incomplete: Again, I cannot access the files.)

    Ideally, I'd like to keep it all in Automator, but if not, I would like to use Chrome to display the pictures in a row by renaming the files and using HTML to arrange it. The files would have to be renamed or the HTML code rewritten each time and then refreshed. I want to keep it simple so that anyone with a MBP can have it.

    Here is an example of the photobooth strip I made. I like adding a static image at the bottom, to show the event - in this case, it was my niece's 7 year birthday party. I used a regular inkjet and had some cheap A4 photopaper cut into 4 strips since that is the minimum size that can be fed through the printer. It got crinkled in the drawer.

    [​IMG]

    So, any help with just that one problem of accessing the files would be really helpful. I think I can figure everything else out. Unfortunately, I don't know how to create apps like the App Store offers, and am annoyed that there isn't something out there that is affordable - the only one offered at the moment costs $100-$500.

    Thanks,

    Tien
     
  2. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
  3. Pojken thread starter macrumors newbie

    Joined:
    Oct 4, 2012
    #3
    I guess I should mention that I have the Retina Display Macbook, with OS X 10.8.2. I'm using a 2880 x 1800 display. Then again, I don't think it matters because I tried the same thing on a friend's Macbook (2010) and got the same results.

    The "Take Video Snapshot" gives me a really poor quality photo. Photo Booth gives me a somewhat better one. Here is a comparison:

    "Take Video Snapshot"
    [​IMG]

    Photo Booth
    [​IMG]

    Tien
     
  4. Pojken thread starter macrumors newbie

    Joined:
    Oct 4, 2012
    #4
    I found this - Applescript to open Show Package Contents

    Can anyone help me translate that to what I need? Again, I'm brand new and would love to figure this out on my own, but I need to make it before Halloween.

    Tien
     
  5. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #5
    I think the "Take Video Snapshot" looks better. Must be getting old and my eyesight has started to deteriorate. :) To take a good photograph you need light. Anyway I found this :

    Exporting and removing images from Photo Booth
    Click on one photo in Photo Booth and hit command-R to reveal the file in the Finder. In the Finder window, hit Command-A to select all, then hold down the command key while clicking with the mouse to deselect any pictures you don't want to move and delete.

    Info : http://hints.macworld.com/article.php?story=20070908142808852

    In Finder go to View --> Show Path Bar. Post a screenshot of the Finder window when you do a Reveal in Finder of a photograph in Photo Booth.
     

    Attached Files:

  6. Pojken thread starter macrumors newbie

    Joined:
    Oct 4, 2012
    #6
    Unfortunately, the Photobooth Library is a library and the only way to get access to it is to (as far as I can tell) "Show Package Contents"

    [​IMG]
     
  7. kryten2, Oct 5, 2012
    Last edited: Oct 5, 2012

    kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #7
    Can you post a screenshot of the Get Info window of the Photo Booth Library?

    Run these in ScriptEditor and post the results :

    Code:
    --choose the Photo Booth Library
    set theLibrary to choose file
    tell application "Finder" to get properties of theLibrary
    -- or
    tell application "Finder" to set theLibraryInfo to info for theLibrary
    and

    Code:
    set photoLibrary to (path to pictures folder as text) & "Photo Booth Library:Pictures:" as alias
    tell application "Finder" to set thePictures to every item of photoLibrary
     
  8. Pojken thread starter macrumors newbie

    Joined:
    Oct 4, 2012
    #8
    I figured it out... rather, a friend did. He used the following Shell script to move the files from one folder to another.

    After that, it was relatively easy to do the rest. Thanks for your help!

    Tien
     

Share This Page