Re: applescript-users digest, Vol 2 #661 - 15 msgs
Re: applescript-users digest, Vol 2 #661 - 15 msgs
- Subject: Re: applescript-users digest, Vol 2 #661 - 15 msgs
- From: "Carl Davaz" <email@hidden>
- Date: Wed, 9 May 2001 14:41:11 -0700
J. Kiely,
Your simple start was pretty close. After your script finishes with
Photoshop, add the call to the Standard Addition:
"set the clipboard to"
This will do what you wanted. Like so:
--I changed the photograph to my path, everything else is the same
tell application "Adobe. Photoshop. 6.0.1"
set workPicId to open file (alias "RGCD:Desktop Folder:ol.sunset1.0506")
adjust workPicId changing the image size to {width:220 as pixels,
resolution:72 as density, constraining proportions:true}
set captionInfo to current document's file info
end tell
set the clipboard to captionInfo as text
What you get is a list of the captionInfo in your clipboard, which can be
pasted where you want like this:
"{caption:\"The sun sets on traffic along the downtown portian of Highway
126 as it follows its West 11th Ave. route through town. (CHRIS
PIETSCH/The Register-Guard) Tuesday, August 1, 2000\", caption
writer:\"CP\", special instructions:\"MAGS OUT, NO SALES\",
category:\"OL\", editorial urgency:normal, byline:\"CHRIS PIETSCH\",
byline title:\"THE REGISTER-GUARD STAFF\", credit:\"THE REGISTER-GUARD\",
source:\"THE REGISTER-GUARD\", originating object name:\"HIGHWAY\",
creation date:\"20010423\", city:\"EUGENE\", province or state:\"OR\",
country:\"USA\", marked as copyrighted:true, copyright notice:\") 2001
THE REGISTER-GUARD, EUGENE, OR, USA\", internet
location:\"
http://www.registerguard.com/standingdocs/rg_copyright.html\"}"
The text above looks like mumbo jumbo because it's in list form, but you
can clean it up by separating the content you really want from file info
by setting variables to just what you're interested in presenting, like:
tell application "Adobe. Photoshop. 6.0.1"
set workPicId to open file (alias "RGCD:Desktop Folder:ol.sunset1.0506")
adjust workPicId changing the image size to {width:220 as pixels,
resolution:72 as density, constraining proportions:true}
set captionInfo to current document's file info
--I added this:
set theCaption to "CAPTION: " & caption of captionInfo & return as text
set theCaptionByline to "PHOTOGRAPHER: " & byline of captionInfo & "/" &
credit of captionInfo & return as text
set theCaptionCopyright to "COPYRIGHT: " & copyright notice of
captionInfo & return & internet location of captionInfo & return as text
end tell
--I added/changed this:
copy theCaption & theCaptionByline & theCaptionCopyright to
labeledCaptionInfo
set the clipboard to labeledCaptionInfo as text
Here is what you get:
CAPTION: The sun sets on traffic along the downtown portian of Highway
126 as it follows its West 11th Ave. route through town.
PHOTOGRAPHER: CHRIS PIETSCH/THE REGISTER-GUARD
COPYRIGHT: ) 2001 THE REGISTER-GUARD, EUGENE, OR, USA
http://www.registerguard.com/standingdocs/rg_copyright.html
Does this help? If you're already using Photoscripter, I'd stick with it.
Carl Davaz
>
Date: 09 May 2001 01:38:17 -0400
>
From: "J. Kiely Jr." <email@hidden>
>
Subject: Photoscripting IPTC captions.
>
To: AS Users List <email@hidden>
>
Reply-To: "J. Kiely Jr." <email@hidden>
>
>
hello,
>
I am trying to write a script that will extract the
>
caption
>
information (IPTC/NAA file info) from a picture that will
>
be uploaded to a website. My problem is that captions have
>
to be uploaded as a separate text file.
>
While Photoscripter easily returns the entire IPTC info
>
I cannot figure out how to just get the caption record, save
>
it as a string and paste it into Word. At this early juncture I
>
just want to get the caption out and into a "paste-able" form
>
using the clipboard to carry it into Word.
>
Any ideas how best to do this?
>
Thanks for any help.
>
>
My simple start...
>
----
>
tell application "Adobe. Photoshop. 6.0.1"
>
set workPicId to open file (alias "SystemG3_3G:Desktop
>
Folder:smile.jpg")
>
adjust workPicId changing the image size to ,
>
{width:220 as pixels, resolution:72 as density, constraining
>
proportions:true}
>
set captionInfo to current document's file info
>
end tell
>
>
tell application "Finder"
>
display dialog captionInfo -- THIS FAILS CAN'T MAKE STRING
>
end tell
>
---------------
Carl Davaz, deputy managing editor
The Register-Guard | 3500 Chad Drive | Eugene, OR 97408
E-mail: email@hidden or email@hidden | Telephone: 541-338-2410
---------------