-
All replies
-
Helpful answers
-
Apr 12, 2015 2:15 PM in response to léonieby TheNakedApe,Nice. I use a referenced library with all image processing done before import to an application, but this is pretty cool. I added a piece to strip out the file extension but it works great. Handy to fix any issues. Thanks! :-)
-
Apr 12, 2015 3:10 PM in response to TheNakedApeby Circa1988,Feel free to share your modifications I've already fixed the error handling a bit on my side so that it doesn't fail.
I also use a referenced library.
-
Apr 13, 2015 3:44 AM in response to léonieby R C-R,léonie wrote:
I experimented a bit, and with Apple Script we could make it a bit simpler, directly in Photos: This will save the installation of exiftool and the necessity to export the files. This way the lossless workflow will be preserved.
Great work, léonie! You should make that into a user tip.
I'm curious. Have you tried this with a large number of images selected? I ask because while I was experimenting with Photos' Applescript support, I wrote a script to add a keyword to every item in its library. I wrote about that in Anyone scripting Photos.app yet? in the OS X technologies forum because I noticed that (I think) Photos takes a brief amount of time to add keywords, & without the delay I added to that script it ran faster than Photos could handle & produce errors.
The mechanism for handling keyword additions is probably different from replacing an empty title with a non-empty one, but if anyone finds that your script chokes with lots of images selected (or mods the script to batch change all the images at once) the fix might be to add a delay, although of course that will mean the script could take a long time to run.
-
Apr 13, 2015 4:28 AM in response to R C-Rby léonie,I'm curious. Have you tried this with a large number of images selected?
Thanks, R C-R. No, I have not yet migrated a large library, so I could only test with a hundred photos in a test library. That worked well. I'll have to look at the OS X technologies forum, it seems, to look for more Photos Scripts.
I like your script. How about a User Tip?
-
Apr 13, 2015 5:07 AM in response to léonieby R C-R,léonie wrote:
No, I have not yet migrated a large library, so I could only test with a hundred photos in a test library.
That should be more than enough to tell if the script needs a delay, assuming you selected that many for one run. If it didn't error out with that, it should be fine as is.
I like your script. How about a User Tip?
I'm not sure how useful my script would be, at least in its present form. There is also the delay thing to consider: I don't know if the delay time would have to be adjusted for slower Macs or larger libraries, & I don't have any good way to test for that.
-
Apr 13, 2015 9:40 AM in response to léonieby DRedfearn,I thought this script would solve my problems - but I can't seem to get it to install as a service - at least, when I check Photos>Services it doesn't show up.
I get as far as creating a new service and dragging the "run apple script" action to the workflow. I then paste in your script. However, at that point, my screen doesn't look like your clip - I don't see the "Service Receives box in Photos App" and the other options I see at the top of your clip. (I do see the Run Apple Script Box as in your clip.) I think that is why when I save it (I chose my desktop) it never makes it to a Photos service. I'm missing something fundamental here. Any idea of where I went wrong?
David
-
Apr 13, 2015 10:04 AM in response to léonieby DRedfearn,Update: I got this to install as a service, but when I run it, I get an error "AppleEvent handle failed". I don't see any other diagnostic information about the error. I'd really like to get this script to run!
David
-
Apr 13, 2015 1:53 PM in response to DRedfearnby Circa1988,I was getting the same "AppleEvent handle failed" with my script; I ended up just catching the error and setting a counter to loop through the items again.
I also found that using selections from a smart album didn't work very well; selections against static albums worked with much fewer of those handle failures.
-
Apr 13, 2015 3:32 PM in response to DRedfearnby R C-R,DRedfearn wrote:
I get as far as creating a new service and dragging the "run apple script" action to the workflow. I then paste in your script. However, at that point, my screen doesn't look like your clip - I don't see the "Service Receives box in Photos App" and the other options I see at the top of your clip.
It sounds like you started by selecting a Workflow document type in Automator. Instead, try starting by selecting the Service document type:
Tip: when you are getting errors from Automator workflows from Applescript actions, it is sometimes helpful to run the script in Script Editor & use the log > Results window to see exactly what's going on step by step.
-
Apr 13, 2015 3:36 PM in response to R C-Rby DRedfearn,Yep, figured that out. I did try the step mode and get the error immediately. I have to play with it more. I have 2200 images that were named in the filename (they are scanned images of art) that I need to get into the title. Goring forward, I can manually add titles - but I would like to fix the images already scanned in.
David
-
Apr 13, 2015 3:46 PM in response to R C-Rby DRedfearn,I got it to run - it seems to help if I don't select too many images to process. I tried this first stepping through the script in the Automator - but now the service also seems to be working. I have no idea why it started working - I changed nothing in the script itself.
I'll have to try this on my wife's art.
Thanks for the suggestions and help.
David
-
Apr 13, 2015 8:36 PM in response to DRedfearnby R C-R,DRedfearn wrote:
I got it to run - it seems to help if I don't select too many images to process.
I have tested it with no more than about 80 images selected at a time. I haven't seen any errors but it does take quite a bit of time to run, maybe 1/4 second per image.
-
Apr 14, 2015 1:59 AM in response to R C-Rby léonie,I haven't seen any errors but it does take quite a bit of time to run, maybe 1/4 second per image.
It is lucky, that we have to only do it once for each photo.
-
Apr 14, 2015 8:16 AM in response to léonieby DRedfearn,I'd like to say thanks to léonie for the filename2title script - it took a little fiddling around, but it is working for me. Wish I had more experience in writing scripts!
David
-
Apr 14, 2015 1:28 PM in response to léonieby Virginia Vail,Is there any way to know if Apple will fix this and provide an easy way to copy the file name into the description field? I have tens of thousands of photos and each has a unique file name that both organizes (by title) and describes each photo.
