1 2 Previous Next 20 Replies Latest reply: Jul 30, 2013 9:32 AM by Kirby Krieger Go to original post
  • 15. Re: End up w. text list of Project names?
    Frank Caggiano Level 7 Level 7 (23,830 points)

    I tried to count exacly, but "wc -l" from the Terminal did not work. There do not seem to be <newline> characters in the textfile, so I had to count the words

    right the script is putting a return (\r) between each project name with this line

    set AppleScript's text item delimiters to return

    rather then the Unix line ending newline (\n). You could convert the \r to \n using tr

     

    Pandora:Desktop frank$ tr '\r' '\n' < source.txt > dest.txt

  • 16. Re: End up w. text list of Project names?
    léonie Level 9 Level 9 (51,720 points)

    rather then the Unix line ending newline (\n). You could convert the \r to \n using tr

     

    Pandora:Desktop frank$ tr '\r' '\n' < source.txt > dest.txt

    A good idea to use the "tr" command to replace the return.

     

    And a surprising result - the translate "tr" quits with "tr: Illegal byte sequence" 

     

    Comparing the source and destination reveals, that Aperture used an "Umlaut" charachter "ä" for one of the automatically generated monthly Photo Stream project names "Mär 2013 Photo Stream". That must have happenend, when I temporarily had set the language to German, when helping a german OP.

    I would not have expected Aperture to generate project names, that cannot be processed by the shell.

  • 17. Re: End up w. text list of Project names?
    Kirby Krieger Level 6 Level 6 (11,945 points)

    Hi Frank -- before I try this, I wanted to report two things and see, again, what you suggest.

     

    I tried the earlier "final change" script five times.  The way I ran the script varied slightly: the first time I pasted it into the Applescript Editor, compiled it, and ran it.  I then saved it as an app, and as a script.  My second time-out came when I ran it as an app (and changed to running on a different library).  I did not use the app again.  The other times I have run it either by pasting into a new Applescript Editor window, compiling, and running, or opening the saved script in the Applescript Editor and running it.  (I mention all this because I don't really know what I'm doing.)

     

    Each time I ran the script there immediately appeared in a Finder window a text file with the name given in the dialog box the script produces (I have in every case used the default).  The first time, on a medium-size Library (1,200 Projects), the script finished instantly.  Finder reported the text file size as 54 KB.  (I just ran the script again on that Library with the same results.)  When I run the script on my large Library (>20,000 Projects), a text file also immediately appears, but Finder reports this as "0" bytes.  Then, eventually, I get the time-out error report from the Applescript Editor.  I thought the immediate posting of the zero byte file was worth reporting.

     

    The medium-size Library in on my system drive.  The larger Library is on an external USB-3 drive mounted through a powered hub (I have no problems running Aperture).

     

    The other thing I wanted to report, is that after running the script on my larger Library, when I then close the Library, Aperture reports that it is "Updating the Library" and presents me with the usual progress bar in percentages.  Updating the Library takes about an hour.  I do not get the "Updating the Library" action on the medium-size Library.

     

    I confirmed that opening, using, and closing the large Library does not give me the "Updating the Library" action when I don't run the script.  (I can't report what happens when I run the script and it works, as I haven't had this happen yet on the large Library.)

     

    One more small thing (I suspect this is unremarkable) -- after the script times out, I have to close the Applescript Editor in order to delete the empty text file.  Just to remove outside variables, after the first time-out error I have rebooted each time before running the script

     

    Thanks for your continued attention  .  Let me know of any suggestions.  I will attempt the new "long time-out" script, but probably not until tonight.

     

    Cheers,

     

    --Kirby.

  • 18. Re: End up w. text list of Project names?
    Kirby Krieger Level 6 Level 6 (11,945 points)

    Finally freed the time to test this ...

    Frank Caggiano wrote:

     

    Hmm, > 20,000 projects is a lot but I wouldn't have expected this.

     

    The following modified script will increase the wait time from 2 mins to 10 mins if this is where the error is that should be more then enough time. let me know how this one works.

    Works flawlessly!  Thanks Frank -- I think I'll have to cycle down to Florda with _another_ beer in my jersey pocket  .

     

    Took about six minutes to finish (nothing else running).

     

    Having a portable list of Project names is actually useful to me.  I appreciate your putting your time and skill into this. 

     

    --Kirby.

  • 19. Re: End up w. text list of Project names?
    Frank Caggiano Level 7 Level 7 (23,830 points)

    Glad it worked.

     

    So are you biking again? I thought I remember you writing that you had to stop due to an accident on the bike? Good news if you are.

     

    I've been out a lot lately, July is always a heavy month. Did my first century in a long time last Sunday. Come on down, but you might want to wait for cooler weather. Maybe I'll ride up to Pa, better have more then one in the cooler though

     

    regards

  • 20. Re: End up w. text list of Project names?
    Kirby Krieger Level 6 Level 6 (11,945 points)

    Frank Caggiano wrote:

     

    So are you biking again? I thought I remember you writing that you had to stop due to an accident on the bike? Good news if you are.

    I am .  Seven years off the bike after what every doctor found to be a death-defying survival (multiple brain-stem bleed; representative quotation: "Can you talk?  Hmmm.  We don't see many like you."), I have finally once again put the narrow rubber to the road.  Beautiful day in Penn's Woods yesterday -- rode an 80 mile loop around our little fur-trading post at the head of the Ohio.  Longest ride since I started again; felt great; slept for eleven hours and missed my morning appointments.

     

    Pittsburgh should be known as the capitol of the Appalachians: it's on the northern fringe, but drew it's might from the mountains' cache of coal and the ease of shipping steel on the rivers and rails here north of the actual mountains.  The areas north, east, and west of the city were all flattened by glaciation, but the city and it's immediate surrounds are -- I assume you are still reading along -- _hilly_.  Shockingly, knee-breakingly, leg-sappingly hilly.  On the other hand, there are no 'gators.

     

    My wife and I will put you up.  If you come I will line the floor of the kitchen with Leffe, and fill the fridge with Gulden Draak.

     

    --Kirby.

1 2 Previous Next