Article View: adobe.scripting.indesign
Article #15730Re: ID2 script not working in ID3 (aka ID CS)
From: alan_ruta
Date: Wed, 19 Nov 2003 14:15
Date: Wed, 19 Nov 2003 14:15
110 lines
4174 bytes
4174 bytes
--Set the frame height to the height of the label
--(in current measurement units).
set myFrameHeight to 2
--Set myFilePath to true to include the entire file
--path in the label; set it to false to include
--only the file name.
set myFilePath to false
tell application "InDesign CS"
activate
---//Selecting all items in a page
-- set mySpread to spread 1 of active document
-- tell mySpread
-- select page items
-- end tell
--///-----------------------
set mySelection to selection
--try
--set myFont to font "Geneva"
--end try
if (count mySelection) > 0 then
--tell (mySelection of selection) --mySpread --paragraph 1
--try
--set applied font to myFont
--tell myItem in mySelection
-- set point size to 8
-- set justification of mySelection to center
--end tell
--end try
--end tell
repeat with myItem in mySelection
if class of myItem is not text �
and class of myItem is not insertion point �
and class of myItem is not text frame �
and class of myItem is not graphic line then
if class of myItem is rectangle �
or class of myItem is oval �
or class of myItem is polygon then
if (count page items of myItem) > 0 then
if class of page item 1 of myItem is image �
or class of page item 1 of myItem is EPS �
or class of page item 1 of myItem is PDF then
set myLink to link 1 of page item 1 of myItem
try
if myFilePath is true then
set myLinkName to file path of myLink
else
set myLinkName to name of myLink
end if
on error
set myLinkName to "File is embedded."
end try
my myMakeLabel(myItem, myLinkName, myFrameHeight)
end if
end if
else if class of myItem is image �
or class of myItem is EPS �
or class of myItem is PDF then
set myLink to link of myItem
if myFilePath is true then
set myLinkName to file path of myLink
else
set myLinkName to name of myLink
end if
my myMakeLabel(myItem, myLinkName, myFrameHeight)
end if
end if
end repeat
end if
end tell
on myMakeLabel(myItem, myLinkName, myFrameHeight)
tell application "InDesign CS"
set myDate to ({the current date} as string)
set myBounds to geometric bounds of myItem
set myX1 to item 2 of myBounds
set myX2 to item 4 of myBounds
set myY1 to item 3 of myBounds
set myY2 to myY1 + myFrameHeight
set myParent to parent of myItem
tell myParent
set myTextFrame to make text frame
try
set myFont to font "Helvetica"
end try
-- set point size of text 1 to "8 pt" --((myLinkName as string) to "8 pt" --(myLinkName) to "8 pt"
-- set font of (myMakeLabel) to "Times"
--set point size of myItem to "8"
--set justification of paragraph 1 of story 1 of myTextFrame to centered
�event Qdrwmove� myTextFrame given �class by �:{1, 1}
set geometric bounds of myTextFrame to {myY1, myX1, myY2, myX2} --Reposition the text box underneath the image box
set text 1 of myTextFrame to ((myLinkName as string) & " " & myDate)
--set myTextBox to (myTextFrame as string)
-- set point size of (myTextFrame of text 1) to 8
--set font of (text 1 of geometric bounds) to "Geneva"
--set font of (text 1 of myTextFrame) to "Verdana"
--set text 2 of myTextFrame to (myDate as string)
--set point size of (myTextBox) to 8
end tell
end tell
end myMakeLabel
Technical Details
Message-ID:
<2cce77d0.1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2cce77d0.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,e16117a3867bc5dc X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-11-19 06:37:56 PST From: alan_ruta@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: ID2 script not working in ID3 (aka ID CS) Message-ID: <2cce77d0.1@webx.la2eafNXanI> Date: Wed, 19 Nov 2003 06:15:03 -0800 References: <2cce77d0.-1@webx.la2eafNXanI> Lines: 113 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit