Scripting help for a tedious process.

Ian Wood wrote a script that takes a list of version names from a Word.doc or plain text doc. and opens Aperture, searches the Library and then creates an album from those gathered images. This is great, for example if a Bride gives you a list of her favorite photos for the design of the final wedding book.
The script works well, however it looks at the whole Aperture library.
If you have versions with the same name it only picks one.
(You may have exactly the same version names scattered around your library because your camera cycles back to 0001 after it reaches 9999)
If someone out there knows how to re-write the script so that it only looks in a particular project as it picks the version names, then an otherwise tedious process would be simplified.
Any help would be appreciated.
The following is a copy of Ian's script.
This script is written by Ian Wood. No warranty is given or implied for the script's use.
Feel free to copy and adapt this script for your own use. Originally written in answer to a thread on the Aperture discussion forum.
Please visit http://www.aperture-assistant.com for more scripts and information about automation and Aperture.
set tfile to (choose file "Pick the text file")
set fref to (open for access tfile) -- now we read the file in
set tSize to (get eof tfile)
set tText to (read fref as string from 1 to tSize)
close access fref
log tText
set tList to every paragraph of tText -- turn the lines into a list
tell application "Aperture"
activate
tell library 1
set this_project to make new album with properties {name:"Results of file name list"} -- you can change this if you want the Album to have another name.
end tell
repeat with i from 1 to the count of the tList
set tName to item i of the tList
set tImgID to "not found"
try
set tImgID to (first image version whose name is tName)
end try
if tImgID is not "not found" then
try
duplicate tImgID to this_project
end try
else
log tName
end if
end repeat
end tell

Ian Wood wrote a script that takes a list of version names from a Word.doc or plain text doc. and opens Aperture, searches the Library and then creates an album from those gathered images. This is great, for example if a Bride gives you a list of her favorite photos for the design of the final wedding book.
The script works well, however it looks at the whole Aperture library.
If you have versions with the same name it only picks one.
(You may have exactly the same version names scattered around your library because your camera cycles back to 0001 after it reaches 9999)
If someone out there knows how to re-write the script so that it only looks in a particular project as it picks the version names, then an otherwise tedious process would be simplified.
Any help would be appreciated.
The following is a copy of Ian's script.
This script is written by Ian Wood. No warranty is given or implied for the script's use.
Feel free to copy and adapt this script for your own use. Originally written in answer to a thread on the Aperture discussion forum.
Please visit http://www.aperture-assistant.com for more scripts and information about automation and Aperture.
set tfile to (choose file "Pick the text file")
set fref to (open for access tfile) -- now we read the file in
set tSize to (get eof tfile)
set tText to (read fref as string from 1 to tSize)
close access fref
log tText
set tList to every paragraph of tText -- turn the lines into a list
tell application "Aperture"
activate
tell library 1
set this_project to make new album with properties {name:"Results of file name list"} -- you can change this if you want the Album to have another name.
end tell
repeat with i from 1 to the count of the tList
set tName to item i of the tList
set tImgID to "not found"
try
set tImgID to (first image version whose name is tName)
end try
if tImgID is not "not found" then
try
duplicate tImgID to this_project
end try
else
log tName
end if
end repeat
end tell

Similar Messages

  • Need help for interface to process employee expenses

    need help for interface to process employee expenses
    i have used the interface tables as
    AP_INVOICES_INTERFACE
    AP_INVOICE_LINES_INTERFACE
    are they the right one
    is there a concurrent program or any API for doing interface

    hi,
    i think what ever table are using for interfacing expenses correct.
    but you have to enter invoice type as expense report.
    Regards,
    Srikanth

  • Startup shell script help for newbie?

    New to UNIX (linux)... need the bash shell script commands for my r.c local file to start my services when server boots.
    I got my ds, dps and admin server in their respective /opt directories. I need the shell commands to have these start. Of course I can start them manually but when I try a line like this in a script, it doesnt work:
    ./var/opt/sun/directory-server/slapd-dsserver/start-dsserver
    Some path problem or dot thing?

    There are a few other things you may want to consider, such as what the default browser is, are tabs being used, is the page loaded yet, etc, but Safari has a do javascript command in it's scripting dictionary. The following script will open a new document and run your specified javascript, or you can go to their NPR Program Stream Page and download a playlist that will run directly from iTunes.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 335px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    set my_script to "NPR.Player.openPlayer(2, 0, '03-21-2008', NPR.Player.Action.PLAY_NOW, NPR.Player.Type.PROGRAM, NPR.Player.Mode.LIVE)"
    tell application "Safari"
    activate
    set the URL of the front document to "http://www.npr.org/"
    if my page_loaded(20) is false then error numner - 128 -- page not loaded in time
    do JavaScript my_script in document 1
    end tell
    on page_loaded(timeout_value) -- from http://www.apple.com/applescript/archive/safari/jscript.01.html
    delay 2
    repeat with i from 1 to the timeout_value
    tell application "Safari"
    if (do JavaScript "document.readyState" in document 1) is "complete" then
    return true
    else if i is the timeout_value then
    return false
    else
    delay 1
    end if
    end tell
    end repeat
    return false
    end page_loaded
    </pre>

  • Need help for a post-processing "trigger"

    Dear all,
    Without getting into much detail, I have a system that is simultaneously introducing a sinusoidal Force (F) and measuring the sinusoidal response (X) of a structure under resonance. I need to acquire the whole time signal, including the free decay response in the end (please find attached a sample picture of the time signal and the corresponding data file), so I cannot use a trigger during the measurement. During the stationary response it may be seen that the signal has a slight negative slope: that is due to a phenomenon of dilatation of my structure that is dissipating heat at the same time. 
    My problem is how to know exactly when my NI-USB 6216 DAQ has stopped the excitation force, which, in my sample waveform would be around 0.025s (I require an automatic process of identifying it).
    Is there any VI, filter or trigger function that might provide me that information?
    Thank you in advance for your help.
    Kind regards,
    Diogo Montalvão
    Attachments:
    R50_18um_controlo_40_60_temp_24_1_12_v0_time_16.txt ‏373 KB

    The brute force method:
    Can't you use another analog input channel and capture the excitation voltage?
    Or if you have a shaker with an amplifier that provide a current monitor output you can capture the excitation current and might find that due to the voltage control some amount of force is still introduced after setting the control voltage to zero   and you might have to implement a system model that include the shaker and the output impedance of your amplifier :0
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • Scripting help for image pop-up within a PDF

    Hi,
    I'm creating some sample eBooks in Acrobat Professional 9 (Mac), and I am stuck on one element that needs to be present. In the text within the PDF, there might be a phrase like, "See Fig. 1". Fig. 1 might not be on that page, however. I know how to create a link in a PDF that will navigate the reader to the page with the image referenced, but that's not good enough. I'd like to have this happen:
    User clicks on "See Fig. 1".
    Popup window appears with the referenced thumbnail image.
    The image's popup window will stay on-screen until dismissed by the user.
    Clicking on the popup thumbnail image calls up a full-size image.
    The added wrinkles are many after we figure out the scripting for the above, but here are two major ones to be addressed right away:
    1) The images are already part of the typeset document converted to PDF, so I am guessing the images would have to be bundled with the PDF somehow. Our users need to use the PDFs in an offline environment, so a call-out to a URL is out of the question.
    2) The PDFs will be read on Macs, PCs, and possibly iPads. If a bundled, local file is called out when a user clicks on "See Fig. 1", how do I set a relative filepath in the call-out?
    Thanks for any help you can provide.
    Andrew

    Here's a sample document that demonstrates some of what you're asking about: https://acrobat.com/#d=aP-2xL45pM57xVkT6d6fSg
    The images are stored in buttons, so there is no concern about having to use external images. Note that this may not work on an iPad since most (all?) PDF viewers on the iPad do not have JavaScript support.

  • Script help for dated folder/file

    would anyone mind helping me finalize an issue i have been needing to finalize? i have gotten some help on creating a script that creates a file or folder with the current date but i am not technically competent enough with applescript or chron or any of these things. i can handle terminal pretty much but some of the explanations while obviously complete have got me confused.
    can anyone take a look at the first one here and just tell me how to get off the blocks with this?
    apparently i need to /copy/ and paste the text into a text editor and save as a .pl file by converting the file extension or is this wrong? it seems to me like the next step is in terminal so with a question or two i am sure i can handle this second part...
    https://discussions.apple.com/message/18109918#18109918
    this is another version but the first seems like i have more editing control or may be more direct for my needs(?).
    https://discussions.apple.com/thread/3526097?start=15&tstart=0

    Well, since you have issues with copying, pasting, and saving a file in the GUI, the second option may be your best choice. Setting up crontab requires some proficiency using the vi text editor.

  • Script Help for iPhoto

    fairly new to Mac. I life iPhot....except, when I mod a photo, it moves to a completely different folder. My simple mind can't grasp the fundamentals of either applescript or automator. Can someone help me write a script that will help move the modified photo's from the iphoto library's "modified" folder, back to the original folder?
    Mahalo,
    Mike

    You can drag and drop the image from iPhoto to wherever you need it. For example, just drag and drop an image from iPhoto to the Desktop, and then you have a copy on the Desktop. If you don't want it in iPhoto anymore, just delete within iPhoto and the original and any modifications are gone. You'll also find buttons in iPhoto that let you easily set your Desktop background, send photos in an email, or publish them with iWeb, among other things.
    iPhoto is for not having to worry about where or how your photos are organized on the your hard drive, just like iTunes does for music. Just let iPhoto handle the organization. Free your mind, let your computer do the work. This is the 21st century, you know.
    Also consider creating albums in iPhoto for your own grouping, and tagging images with keywords and comments so you can create smart albums to automatically do the grouping for you. You can also drag and drop an image from one film roll to another or combine film rolls. Time to let go of the Finder when it comes to organizing your images.

  • Basic script help for a newbie?!?!

    Need help with a basic script, I need to display 5 input fields in a single dynamic field. And i need them to have a certain order of display, ie: input 1 is displayed on line 1, 2 on the next line, etc. any help would be appreciated
    I have been trying various scripts but i either make the second input field replace the first one, or i cant get the vars to populate the field with a button.. Im kinda lost.

    Show what you have tried so far that give you the results where you either replace fields or can't get vars to populate them with a button.

  • Urgent !!! - Java script help for events in adobe form

    Hi ,
    We have requirement  where we have 5 buttons on interactive form which will retrive data from R/3 system .
    1) How can i distingish the event of each button  ?
    For Ex : We have 5 buttons namely , GetPlantcode , GetStatus, SubmittpSAP etc..
    We hav only 2 events on adobe form - Submit to SAP and SAPCheckFields.
    Please let me know some alternative by which i can sent some variable to webDynpro which distinguishes them.
    2) How to set a value for the context variable on button click event ?
    Ex : I have a context node ( data node ) bind to adobe interactive adobe component on a webDynpro application. If i want to set Selectindicator ( value attribute in data Node ) a value on a button click , Please let me know the java script how i can do this.
    Happy New Year for all
    Nanda

    Hi ,
    We found one work around for this. It seems to solve our issue for now.
    Set a text field on adobe and try to set it with some value in each button click. We can get retrived that value in webdypro application through context bind value node to text field.
    Using the value in the value node we have applied different logic in same event submit to SAP.
    Nanda

  • Script help for people and group sharepoint field

    Hello ,
    I want to perform a check by using javascript for people picker controls
    sudhanshu sharma Do good and cast it into river :)

    Hi,
    According to your post, my understanding is that you wanted to perform a check using JavaScript for people picker controls.
    Did you mean you wanted to make a validation of people picker control?
    You can do the steps as below.
    Just Add a content editor webpart in you list form(NewForm.aspx or EditForm.aspx) and put the script below: To add CWEP to you list form you can refer Link
    2. Add your 'Control UserField_upLevelDiv ID'(Using View Source you can get upLevelDiv  id of that contol)
    <script type="text/javascript">
    function getPickerInputElement(identifier)
    var tags = document.getElementsByTagName('DIV');
    for (var i=0; i < tags.length; i++)
    var tempString = tags[i].id;
    if ((tempString.indexOf('UserField_upLevelDiv') > 0))
    if(identifier == tempString)
    var innerSpans = tags[i].getElementsByTagName("SPAN");
    for(var j=0; j < innerSpans.length; j++)
    if(innerSpans[j].id == 'content')
    return innerSpans[j].innerHTML;
    return null;
    var PickerPerson = getPickerInputElement('Control UserField_upLevelDiv ID');
    alert(PickerPerson);
    // For Validation
    if(PickerPerson == null)
    alert('Please enter PP value.');
    return false;
    </script>
    More information:
    http://ankursharepoint.blogspot.in/2012/10/javascript-validation-of-people-picker.html
    There are some similar threads for your reference.
    http://social.msdn.microsoft.com/Forums/en-US/f1c2a651-a0fb-484d-af33-e7084439b6c8/validate-sharepoint-people-picker-using-javascript?forum=sharepointgeneralprevious
    http://social.msdn.microsoft.com/Forums/en-US/df1664c6-a799-4f2b-8f9e-ac8c915c91f6/how-to-validate-people-picket-control-at-client-side-using-javascriptdesigner-in-new-formaspx?forum=sharepointgeneralprevious
    http://social.msdn.microsoft.com/Forums/en-US/9021f00f-8830-4c3a-bdf1-03be84cfb6ca/people-picker-required-field-validation?forum=sharepointdevelopmentprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Daily activity help for script... and investgating some issue

    hi
    i am new to apps.i fil i need some script to solve some daily activity issues and solving some issue.
    can anyone help me or list of issue(s).I know it may different from site to site but i want very common list.so that issues could be resolved quickly.
    regards

    hsawwan wrote:
    Hi,
    invalid object lists and number.Query dba_objects for invalid objects and compile it either manually or via adadmin.yes. i know but i need to schedule this with scripts so that it will compile jar files,invld obj etc.
    >
    failing patches.Check the patch log file.
    diagonostics failed patches.Check the patch log file as well as the workers log file.where is the worker logfile?
    >
    backup of archivelog and database.Test the backup periodically.how?
    >
    gathering statistics for apps and dadatabase users.Schedule "Gather Schema Statistics" concurrent program on regular basis.option is dbms_job right?
    >
    specific concurrent manager/log lists for specific requests.Check the CM log file along with the failed request log file.i notice FND<sum number>.log usually created for this but for specific log file is needed to query from db.for this reason i want to use some scripts.
    >
    shrinking apps tablespaces to utilise the spaces and enhancing the performance of apps.Shrinking tablespaces does not enhance performance.
    may not enhance performance but may enhance the disk space.
    See (Note: 122669.1 - How to Perform a Health Check on the Database).
    monitoring alerts.
    monitoring forms and report and generating trace files.You can do from OAM.
    monitoring triggers Write an alert to notify you in case the status of the triggers changed.
    startup total apps and shutdowns total apps (this actually sysadmins of clients want)Usually, we review the startup/shutdown scripts log files.
    total cloning process within a night.You will have to review the log files.
    Thanks,
    Hussein

  • Help for find/change glyphs script

    Hi everyone!
    I need help for creating a script (or modifying existing script) that should replace every Cyrillic character  from an old ASCII font with the same Cyrillic character but from new Unicode font.
    For example: Capital letter 'A' GID=107 from old font (Lazurski) should be replaced with 'A' GID=630 from new one (Myriad Pro).
    I can do this by using Indesign Find/Change - Glyphs, but this will take me too much time.
    So, I need a scrip for this job.
    My first attempt was to use the FindChangeByList script by modifying the FindChangelist.txt document, but without success.
    Here is what I've used until now:
    1)  glyph {glyphID:107, appliedFont:"Lazurski"} {glyphID:630, appliedFont:"Myriad Pro"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    2)  glyph {findWhat:"u00C0", appliedFont:"Lazurski", fontStyle:"Bold"} {changeTo:"0410", appliedFont:"Myriad Pro", fontStyle:"Bold"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find ASCII A replace with Unicode A.
    Both lines didn't change anything. What is wrong?
    Any help is welcome!
    Regards,
    Veselin
    P.S. Indesign CS5

    Thank you Jongware!
    The codes (both ID and Unicode) are correct for sure, but even with correct notation (obviously my was wrong) the script don't change anything.
    Here is the line in the FindChangeList:
    text {findWhat:"\u00C0", appliedFont:"Lazurski", fontStyle:"Bold"} {changeTo:"\u0410", appliedFont:"Myriad Pro", fontStyle:"Bold"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find ASCII A replace with Unicode A.
    Update:
    Finally, I found what is wrong with the script - the properties "caseSensitive:false".
    By removing that properties the script works fine.
    So, I successfully converted a book with old ASCII Cyrillic font to Unicode Opentype font.

  • Help for processing of the FM 'BAPI_INSPOPER_GETDETAIL'.

    Hi,
       Can anyone please help me with the processing of the FM 'BAPI_INSPOPER_GETDETAIL'.
    There seems to be no documentation on this FM on the net or on SDN.
    I basically need to use this FM to fetch the values of three fields Target Value (SOLLWERT) , Lower Tolerance Limit (TOLERANZUN) and Upper Tolerance Limit (TOLERANZOB).
    Currently I am not able to this but there seems to be some way out of it. Please help.
    Thanks.

    Hi,
      Please pass the below data for BAPI 'BAPI_INSPOPER_GETDETAIL'.
    CALL FUNCTION 'BAPI_INSPOPER_GETDETAIL'
      EXPORTING
        insplot                               = '010000000001'
        inspoper                             = '0010'
        read_insppoints                   = 'X'
        read_char_requirements       = 'X'
        read_char_results                 = 'X'
        read_sample_results             = 'X'
        read_single_results                = 'X'
        read_chars_with_classes         = 'X'
        read_chars_without_recording   = 'X'
        res_org                                    = ' '
        char_filter_no                           = '1   '
        char_filter_tcode                      = 'QE11'
        max_insppoints                        = 100
        insppoint_from                          = 0
    TABLES
         CHAR_REQUIREMENTS                  =  it_charreq
    From table IT_CHARREQ you can get lower tolerance limit(IT_CHARREQ - LW_TOL_LMT),Upper tolerance limit(IT_CHARREQ - UP_TOL_LMT),Target value (IT_CHARREQ-TARGET_VAL).
    Hope this may helpful.
    Regards,
    Sravanthi.

  • This is so basic: How do you turn off Apple TV, or do you just exit by changing the Input back to regular TV? When I put Apple TV to sleep, I had to log in again, a very tedious process with that awful "announcer" for the hearing impaired (how to remove?)

    This is so basic: How do you turn off Apple TV, or do you just exit by changing the Input back to regular TV? When I put Apple TV to sleep after I installed it, I had to log in again, a very tedious process with that awful "announcer" for the hearing impaired (and how to remove that?).

    Welcome to the Apple Community.
    The Apple TV will put itself to sleep. I'm not sure what you needed to log into again, but you shouldn't have to. Do you have a little more detail about what happens.

  • F4 help for a single field in interactive form

    Hi Experts,
    I am working in HRAS process.I created a Form Scenario and an Adobe Form.  I linked my interactive form in portal using standard Start Processes iView . Now I have to create a value help(F4 help) for 'STATE' field based on 'COUNTRY' field value in adobe form.  I filled the Input value Help in the corresponding Form Scenario field. But in portal the adobe form shows the field as a single field only.
    How I can I attach the manual F4 help to 'COUNTRY' field?
    The how to  vary the F4 help values in 'STATE'  fied based on 'COUNTRY'  field?
    Do I need to code  in Java script for this?
    Please provide some inputs with code sample
    Thanks in advance,

    Lek,
    Check Nikhil's reply in this [thread|Re: Reg: value help from BADI is not displayed in the HCm form;. It should probably help you.
    Chintan

Maybe you are looking for

  • Remote startup and shutdown of of PXIe controller running Labview RT (WoL)

    I would like to be able to remotely start up and shut down a PXIe-8133/PXIe-8130 controller remotely over the LAN.   I can see that the hardware specs for the PXIe-8133 supports wake on lan (WoL), but I'm not sure about the 8130 (although it seems to

  • Networking Delay Causing Mayhem

    First, I know that others have reported networking issues in Leopard. I wanted to start a new topic with my specific issue and see if others are having the same problem. When accessing a website, sometimes there is a delay of about 10 seconds. Think

  • Concurrency wait on an insert statement

    Hello All, I am running Oracle RAC 2 nodes 11g R2 on AIX 7.1 I have a table with unique index, and the application is doing inserts/updates into this table. Suddenly and for about half a minute I faced a high concurrency waits on all the processes ru

  • Loading hierarchies in BW from excel

    Hi all , how to load hierarchies from excel into the BW . do the excels need to be in .csv format or can they be loaded from .xls format. do i need to have a specific format of the columns in excel as a pre-requisite for loading . please also let me

  • Application - current vi path different - config file

    If I want to use config files (ini files) with an application, to store settings between runs of the application, I would like to name the conifg file the same as the application, just with a different ending: application.ext with config file applica