Needed: Script for exporting iPhoto albums into a file structure

Hello all! I have no experience with AppleScript, but I heard it should be possible to write a script which helps to copy/export a iPhoto album structure into an according directory structure. Does anybody already have such a script?
Thx for any information on that!

Thomas,
I have created an AppleScript along with the TextCommands OSAX that duplicates all of the albums in iPhoto to a folder called "Albums" on the desktop. It is quite slow because of the need to open an Info window in Finder to get the path to the original photo but gets the job done.
If you wish it could be modified to provide an ability to select individual albums for duplication. Let me know if you are interested in the latter. I am also seeing whether the album structure can be created directly in a burn folder so that CDs/DVDs can be rapidly burned.
TextCommands is donationware and available at the following location:
http://osaxen.com/files/textcommands1.0.1.html
and should be placed in the following location for the AppleScript to see it:
~/Library/ScriptingAdditions/
click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">property PathToDesktop : path to desktop as string
property PathToPictures : path to pictures folder as string
property PathToiPhotoLibrary : PathToPictures & "iPhoto Library"
property PathToiPhotoAlbums : PathToiPhotoLibrary & ":Albums"
property PathToCopiedAlbums : PathToDesktop & "Albums"
tell application "Finder"
activate
set theCopiedAlbumsFolder to duplicate folder (PathToiPhotoAlbums as alias) to desktop
set theAlbums to folders of folder PathToCopiedAlbums
set theExtraneousFiles to files of folder PathToCopiedAlbums
delete theExtraneousFiles
repeat with anAlbum in theAlbums
repeat with anAlias in anAlbum
-- need to use GUI access to grab the path to the original photo
open information window of anAlias
tell application "System Events"
tell process "Finder"
-- grab the path to the original file
set PathToTheOriginalPhoto to value of static text 2 of scroll area 1 of window 1
end tell
end tell
close window 1
-- need to remove some extraneous material and convert to AppleScript path format
tell application "TextCommands"
split PathToTheOriginalPhoto using {":", "../"}
set PathToTheOriginalPhoto to item 4 of the result
set PathToTheOriginalPhoto to search PathToTheOriginalPhoto for "/" replacing with ":"
set PathToTheOriginalPhoto to (PathToiPhotoLibrary & ":" & PathToTheOriginalPhoto) as alias
end tell
(* unfortunately there seems to be bug in duplicate file to another folder so must use a copy, , delete the alias, move, and clean up name of copied file sequence to accomplish the equivalent *)
-- duplicate the original in the original album folder
set theCopiedPhoto to duplicate PathToTheOriginalPhoto
-- Delete the alias in the Copied Album
delete anAlias
-- Move the copied photo to the Copied Album
set theCopiedPhoto to move theCopiedPhoto to anAlbum
-- Remove the "copy" from the photo names
set NameOfPhoto to name of theCopiedPhoto
tell application "TextCommands"
set name of theCopiedPhoto to search NameOfPhoto for " copy" replacing with ""
end tell
end repeat
end repeat
end tell</pre>
PowerBook 12" Mac OS X (10.4.6)

Similar Messages

  • Need script for exporting images to EPS

    I need to write a script to export a whole bunch of files from Indesign CS3 to EPS files. Right now we do them one at a time...here are the steps we take that we would need included in the script...
    Select all (Control A), ungroup, convert to outlines (control-shift O), export (need to be able to say black or white or RGB) and then close the file without saving.
    and if there was anyway to loop this script for 20 files at a time that would be really helpful.
    Can any help or direct me to a website that can help.
    Thanks!
    Marissa

    Maybe this one: http://www.kahrel.plus.com/indesign/batch_convert_cs3.html
    Peter

  • Script for Exporting 2 Pgs into 1 PDF???

    Hello, I was wondering if anyone can help me. I know there is a script that can export each page of Indesign file as a separate PDF, but is there a script out there to export every two pages of Indesign file.
    Basically what I need to do is create 300 customized documents (based on personal company information) and Export them to a PDF so that I may e-mail one to each company. The document must be two pages, the first page has the personalized (merged) information, but the second page will be exactly the same on all of them.
    Can you tell me how I can do this in Indesign, or if not Indesign, Acrobat? I ran a test with the Data Merge system in Indesign. (I created a .CSV file with 2 columns; Company Name and Company Product and took 5 five companies from the master list to test.)
    After the merge, all the fields populated correctly but I wound up with a 10 page .INDD document. (the odd number pages are the ones with all the "merged" personal info, while all the even number pages exactly the same) What I need now is every 2 pages to be exported as 1 PDF file.
    Is there is an easier way to do this? And if not in Indesign, is there an easy way to extract 2 pages at a time in Acrobat?
    Thank you very much for any help, much appreciated,
    Kevin

    Hi Kevin,<br />Here is another version.<br />copy/paste into a text editor then save as a .jsx and place it in the script folder.<br />The only thing you have to modify is the name of your pdf preset. I thought about a dialog where tou could have switched frome one preset to another easily. But it may much more efficient to just modify the name of the preset. If you want you an also make a copy with another PDF preset then rename it.<br /><br />ad = app.activeDocument;<br />pg=ad.pages;<br />var docpath = ad.filePath;<br />var docname = ad.name;<br />var nb = (Math.round(Number(pg.length/2)))<br />for(i=0; i<nb;i++)<br /><br />{<br />]var pgrgstart = (pg[(2*i)].name);<br /><br />]if(pg[(2*i+1)]==-1)<br /><br />]{<br /><br />]]var pgrgend = pgrgstart;<br /><br />]}<br /><br />]else<br /><br />]{<br /><br />]]var pgrgend = pg[(2*i+1)].name;<br /><br />]}<br /><br />]app.pdfExportPreferences.pageRange = pgrgstart+"-"+pgrgend; <br /><br />]var myPDFExportPreset = app.pdfExportPresets.item("your PDF preset"); <br /><br />b //enter the name of your PDF preset instead of your PDF preset<br /><br />]ad.exportFile(ExportFormat.pdfType, File(docpath+"/"+docname.split(".indd")[0]+"_"+"pg_"+i+"_to_"+(i+1)+".pdf"), false, myPDFExportPreset); <br /><br />}<br /><br />alert("done");

  • Flash AS3, Need script for .exe to open another .exe file

    Hi all,
    Has anyone got a script to allow an .exe file to open another .exe file? If so, I could sure use the help.
    many thank in advance.
    HD superglide

    You can use fscommand("exec") to run a batch file to open an exe - but exe is a Windows executable, not for Mac OS
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • Script for export in datapump  -- help needed !!!

    hello all,
    i am using the following script as batch file in my database for export
    script:
    =========
    exp name/password file=d:\exp\%date%.dmp full=y log=d:\exp\exp.log an this will replace the first file(monday) on next monday.
    similar way i need a script for data pump for full database export using datapump
    thanks ,
    gold

    login to database as a dba and create directory for your dumpfile path.
    create directory dpump_dir as 'd:\exp';
    and then use the below script for export.
    expdp username/password full=y directory=dpump_dir dumpfile=%date%.dmp logfile=exp.log

  • How to export iPhoto Albums to Library or Book?

    How can I export iPhoto Albums to the Library or iBook?

    You're posting in the iPhoto for iOS forum... you know, iPad, iPhone, etc.  That's why I brought up the camera roll.  If your question is directed to iPhoto on the Mac, this isn't the right forum.  You need to go here:
    https://discussions.apple.com/community/ilife/iphoto

  • How do I get photos in a specific iPhoto Album into my Photo Stream?

    How do I get photos in a specific iPhoto album into My Photo Stream so that I can use my Apple TV to show them in a slideshow on my TV?

    That is not possible - PhotoStream has no organizational capability - no albums or other organization
    With the correct software versions You can import from PS into an iPhoto event on your Mac either automatically (by setting the iPhoto preference to do that) or manually and then you can add the photos ot an iPhoto album and sync to Apple TV
    what version of iPhoto do you have? Is OS X 10.7.5 correct for your OS?
    LN

  • I'm trying to place an order for 3 iPhoto Albums, but the system won't take the billing address. I'm in Costa Rica and will send the albums to an address in Miami. Can't find any support live chat for billing issues.

    I'm trying to place an order for 3 iPhoto Albums, but the system won't take the billing address. I'm in Costa Rica and will send the albums to an address in Miami. Can't find any support live chat for billing issues.

    You need to use a credit card with a billing address in the same country as the delivery address.  Since there's no Apple Print Store for Costa Rica I assume you're using the United States print store.  Therefore you'll need a credit card with a billing address in the US.
    OT

  • Shell script for export backup in oracle 11g

    Hi,
    Oracle version 11.2.0..
    O/S-AIX
    How to write shell script for export full backup in oracle 11g and also need to remove 2 days of old backup.
    Regards,
    Raju

    How to write shell script for export full backup in oracle 11g
    Do you mean that export is your backup strategy ? is your database running in noarchivelog mode ? if so, then why ? if not so, then why not RMAN ?
    need to remove 2 days of old backup.
    If that mean remove files older than 2 days, you can use something like this :
    $ find <absolute directory path> -mtime +2 -exec rm {} \;

  • Exporting R3 tables into Flat Files for BPC

    Dear BPC experts,
    I understand currently the way for BPC to extract data from R3 is via flat files. I have the following queries:
    1) What exactly are the T codes and steps required to export R3 tables into flat files (without going through the OpenHub in BI7)? Can this process be automated?
    2) Is Data Manager of BPC equivalent to SSIS (Integration Services) of SQL Server?
    Please advise. Thanks!!
    SJ

    Hi Soong Jeng,
    I would take a look at the existing BI Extractors for the answer to Q1, I am working on finishing up a HTG regarding this. Look for it very soon.
    Here is the code to dump out data from a BI Extractor directly from ERP.
    You need dev permissions in your ERP system and access to an app server folder. ...Good Luck
    *& Report  Z_EXTRACTOR_TO_FILE                                         *
    report  z_extractor_to_file                     .
    type-pools:
      rsaot.
    parameters:
      p_osrce type roosource-oltpsource,
      p_filnm type rlgrap-filename,
      p_maxsz type rsiodynp4-maxsize default 100,
      p_maxfc type rsiodynp4-calls default 10,
      p_updmd type rsiodynp4-updmode default 'F'.
    data:
      l_lines_read type sy-tabix,
      ls_select type rsselect,
      lt_select type table of rsselect,
      ls_field type rsfieldsel,
      lt_field type table of rsfieldsel,
      l_quiet type rois-genflag value 'X',
      l_readonly type rsiodynp4-readonly value 'X',
      l_desc_type type char1 value 'M',
      lr_data type ref to data,
      lt_oltpsource type rsaot_s_osource,
      l_req_no type rsiodynp4-requnr,
      l_debugmode type rsiodynp4-debugmode,
      l_genmode type rois-genflag,
      l_columns type i,
      l_temp_char type char40,
      l_filename    like rlgrap-filename,
      wa_x030l      like x030l,
      tb_dfies      type standard table of dfies,
      wa_dfies      type dfies,
      begin of tb_flditab occurs 0,
    *   field description
        fldname(40)  type c,
      end of tb_flditab,
      ls_flditab like line of tb_flditab,
      l_file type string.
    field-symbols:
      <lt_data> type standard table,
      <ls_data> type any,
      <ls_field> type any.
    call function 'RSA1_SINGLE_OLTPSOURCE_GET'
      exporting
        i_oltpsource   = p_osrce
      importing
        e_s_oltpsource = lt_oltpsource
      exceptions
        no_authority   = 1
        not_exist      = 2
        inconsistent   = 3
        others         = 4.
    if sy-subrc <> 0.
    * ERROR
    endif.
    create data lr_data type standard table of (lt_oltpsource-exstruct).
    assign lr_data->* to <lt_data>.
    call function 'RSFH_GET_DATA_SIMPLE'
      exporting
        i_requnr                     = l_req_no
        i_osource                    = p_osrce
        i_maxsize                    = p_maxsz
        i_maxfetch                   = p_maxfc
        i_updmode                    = p_updmd
        i_debugmode                  = l_debugmode
        i_abapmemory                 = l_genmode
        i_quiet                      = l_quiet
        i_read_only                  = l_readonly
      importing
        e_lines_read                 = l_lines_read
      tables
        i_t_select                   = lt_select
        i_t_field                    = lt_field
        e_t_data                     = <lt_data>
      exceptions
        generation_error             = 1
        interface_table_error        = 2
        metadata_error               = 3
        error_passed_to_mess_handler = 4
        no_authority                 = 5
        others                       = 6.
    * get table/structure field info
    call function 'GET_FIELDTAB'
      exporting
        langu               = sy-langu
        only                = space
        tabname             = lt_oltpsource-exstruct
        withtext            = 'X'
      importing
        header              = wa_x030l
      tables
        fieldtab            = tb_dfies
      exceptions
        internal_error      = 01
        no_texts_found      = 02
        table_has_no_fields = 03
        table_not_activ     = 04.
    * check result
    case sy-subrc.
      when 0.
    *      copy fieldnames
        loop at tb_dfies into wa_dfies.
          case l_desc_type.
            when 'F'.
              tb_flditab-fldname = wa_dfies-fieldname.
            when 'S'.
              tb_flditab-fldname = wa_dfies-scrtext_s.
            when 'M'.
              tb_flditab-fldname = wa_dfies-scrtext_m.
            when 'L'.
              tb_flditab-fldname = wa_dfies-scrtext_l.
            when others.
    *         use fieldname
              tb_flditab-fldname = wa_dfies-fieldname.
          endcase.
          append tb_flditab.
    *        clear variables
          clear: wa_dfies.
        endloop.
      when others.
        message id sy-msgid type sy-msgty number sy-msgno
        with  sy-subrc raising error_get_dictionary_info.
    endcase.
    describe table tb_flditab lines l_columns.
    " MOVE DATA TO THE APPLICATION SERVER
    open dataset p_filnm for output in text mode encoding utf-8
      with windows linefeed.
    data i type i.
    loop at <lt_data> assigning <ls_data>.
      loop at tb_flditab into ls_flditab.
        i = sy-tabix.
        assign component i of structure <ls_data> to <ls_field>.
        l_temp_char = <ls_field>.
        if i eq 1.
          l_file = l_temp_char.
        else.
          concatenate l_file ',' l_temp_char  into l_file.
        endif.
      endloop.
      transfer l_file to p_filnm.
      clear l_file.
    endloop.
    close dataset p_filnm.
    Cheers,
    Scott
    Edited by: Jeffrey Holdeman on May 25, 2010 4:44 PM
    Added  markup to improve readability
    Edited by: Jeffrey Holdeman on May 25, 2010 4:47 PM

  • How to export iPhoto Album in iMAC and have similar folder structure(with Timestamps) which can be viewed in finder

    How to export iPhoto Album in iMAC and have similar folder structure(with Timestamps) which can be viewed in finder
    In simple terms, I wanted to view the photos in Windows system, similar strcture of iPhotos

    If you want to copy all of your photos to a Windows machine and have them in folders representing the iPhoto Events the were in quickly and easily just do the following:
    1  - open the library with the Finder as shown in this screenshot:
    2 - COPY the Originals/Masters folder to the Desktop.
    3 - copy the Originals/Masters folder to the Windows machine.
    This will give you all of your original image file in their Event folder on the Windows machine.
    NOTE:  With iPhoto 8 or newer the Event folders in the Masters folder will be titled by date (EXIF) if imported from a camera.  If imported from a folder the event folder will have the same title as the source folder.  If imported singularly or in a group without a folder the title will be a date, either the EXIF date or import date.
    With iPhoto 7 (08) and earlier the Event folders in the Originals folder will have the same title as the Event has in the library.
    This method would be quicker but not provide the additional metadata you might have added in iPhoto like keywords, titles, descriptions that exporting out of iPhoto with Format=JPEG and the checkboxes selected to include keywords, titles, places, etc, checked.
    OT

  • How do I export iPhoto album in Mac to iPhone5s

    How do I export iPhoto album in Mac to iPhone5s

    See this support document. iTunes: Syncing photos - Apple Support

  • Scripts for Exporting Master/Work Rep

    Hi,
    I want to automate the export process and in turn was looking for any scripts for exporting the whole ODI Work/Master Rep. I checked the CLASS objects and we donot have any CLASS names for Repository exports.
    Thanks in advance for any answers..!

    Created for 10g [ http://odiexperts.com/automize-the-backup-using-odi-exports]
    but should work for 11g too :)

  • Export batch data into CSV file using SQL SP

    Hi,
    I have created WCF-Custom receive adapter to poll Sql SP (WITH xmlnamespaces(DEFAULT 'Namespace' and For XML PATH(''), Type) . Get the result properly in batch while polling and but getting error while converting into CSV by using map.
    Please can anyone give me some idea to export SQL data into CSV file using SP.

    How are you doing this.
    You would have got XML representation for the XML batch received from SQL
    You should have a flat-file schema representing the CSV file which you want to send.
    Map the received XML representation of data from SQL to flat-file schema
    have custom pipeline with flat-file assembler on the assembler stage of the send pipeline.
    In the send port use the map which convert received XML from SQL to flat file schema and use the above custom flat-file disassembler send port
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • HT1727 How do i get itunes to recognize music imported into the file structure?

    How do I get iTunes to recognize music imported into the file structure?

    Press Alt or Ctrl+B to reveal the menu bar if needed.
    Use File > Add Folder to Library if you just want to import it.
    If you're trying to relink broken entries in a library with the corresponding media then some more details would help.
    tt2

Maybe you are looking for