![]() |
Quote:
Um, out of curiosity, how does one go about doing that? I could see me doing that with Java or even learning object-c to do it. Why would anyone use AppleScript, wouldn't it be considerably slower? |
Yes it's often slower that C, but not slower than Java typically. People do it because they want to write an app that involves a good deal of interaction with other applications and they want easy access to Apple Events.
|
can you make an apple script that transfers money from your bank account to mine?;)
I would look into making apple scripts to automate certain mundane tasks, like burning a CD, or composing an email or anything that would require some sort of manual data entry. |
Quote:
GraphicConverter would be just fine as long as it does not mess with the photo itself. Is that possible? I have both GraphicConverter and the latest Photoshop if that helps. All I want is a batch application that will "Copy Spotlight Comments" then "Paste results in IPTC comments". You would not believe how hard such a thing is to find! |
I wrote a script a while back see this thread on bbs.applescript.net .
It uses GraphicConverter to write IPTC from user input, But is should be very easy to convert it to your needs |
Hi Schneb;
This should do it (try it on a duplicate set, of course): Code:
set F to choose folderCode:
set F to choose file of type {"public.image"} without invisibles with prompt "Choose a single image" |
Thanks NovaScotian, I gave it a try and it did not work. I made sure GraphicsCoverter was running and tried again--nothing. I then changed the application to Adobe Photoshop, and still, no result. Sigh...
|
Quote:
update to the latest version and try again. Also, I finder when i use my script to do this, its best that GC is running before I run the script. |
Quote:
Try this on one of your files and tell me what K is. Perhaps I've got the kinds wrong. Code:
tell application "Finder" to set K to kind of (choose file without invisibles) |
Sorry about that. Definitely not enough input there.
It compiled OK, I ran it, it asked for a folder, I gave it a folder, it ran, but no comments were transferred. No errors. The result of your script is "Adobe Photoshop JPEG file" Can you tell it to just accept whatever it is? I do have a few audio files and movie files, but it can just ignore those. I believe I only have the following in my archive... JPEG, MOV, MP3. About 90% is JPEG. |
Quote:
Code:
set F to choose file of type {"public.image"} without invisibles with prompt "Choose a single image" |
Quote:
"GraphicConverter got an error: An error of type -2 has occurred" I then came to find out that any photo file that did not have any IPTC text written will give the error above. I put in some IPTC text via Photoshop CS and got the following output... {"Emma with Robert, Aunt Mary and others.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "-1", "", "", "", "", ""} |
I've added Adobe Photoshop JPEG file to the list (only Adobe would stick it that way; jpeg is jpeg)
Code:
set F to choose folder |
I'm still not getting anything to write to the IPTC.
Not sure if GraphicConverter recognizes just iptc as anything. Should there be any kind of other parameter to tell it just where in the iptc--such as "description"? Note: The following only returns the Spotlight Comments of the folder, and not the content of the files therein... Code:
set F to choose folderNote, I changed "set C to comment of F" to "set C to comment of I" and got a better result. The following script gave an error... Code:
set F to choose folder |
Ahh, Schneb; apologies -- a bug. Change the F in the line below to an I
set C to comment of F -- get the comment from the Finder should be set C to comment of I -- get the comment from the Finder |
Yes, as well as the next line, correct?
set C to comment of I -- get the comment from the Finder tell application "GraphicConverter" to set file iptc of I to {C} -- set it with GC It's running without errors, however, the comments are not being written to the IPTC. Does it need a parameter to say "where" in IPTC? I definitely feel bad about hijacking Zalister's post here. I will write up a new question so we can transfer this exchange there. Sorry Zalister!! |
Quote:
If you don't say "where" as in Mark's script, the comment is just the first item in the list. I can't check that because I don't have photoshop. Code:
set Fldr to choose folder |
I have tested this and it works.
Code:
set F to choose folder |
NovaScotian, you are brilliant. It indeed works! I tested it on a folder full of photos and it wrote all my Spotlight comments to the description IPTC, just like I wanted. Now if I ever lose my .DS_Store files, I will not pine because of the loss of Spotlight comments--it is now a part of the photo itself!
Thanks so much for your time on this. Schneb |
More than welcome, Schneb; Sorry it took so long to debug it. :rolleyes:
|
| All times are GMT -5. The time now is 01:06 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.