Article View: adobe.scripting.indesign
Article #15277Re: Retaining/Inheriting when replacing images - AS
From: Olivier_Berquin
Date: Wed, 10 Dec 2003 08:00
Date: Wed, 10 Dec 2003 08:00
35 lines
1846 bytes
1846 bytes
> A new message was posted by Casey D'Andrea in
>
> InDesign Scripting --
> Retaining/Inheriting when replacing images - AS.
>
> I just realized something. My current script is setup to fit the image in the
> frame proportionally. So all I need to do if add an if statement that
> determines whether or not the frame already contains an image or not.
> Something like this?
>
> if exists page item 1 of item 1 of selection = true then
> place theFile on myBox
> else
> place theFile on myBox
> fit myBox given proportionally
> end if
You are close... Do you know the "try .. end try" statement ?
If not, please, download the AppleScriptLanguageGuide.pdf at
<http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScript
LangGuide/AppleScriptLanguageGuide.pdf>
tell application "InDesign 2.0.2"
set myDoc to active document
tell myDoc
try
set PageItem1 to page item 1 of item 1 of selection
place theFile on myBox
on error
place theFile on myBox
fit myBox given proportionally
end try
end tell
end tell
Technical Details
Message-ID:
<BBFC9117.39E8%olb@microscript.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2cce0284.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,f8f302a73e62fbf5 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-12-10 00:07:42 PST From: Olivier_Berquin@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: Retaining/Inheriting when replacing images - AS Message-ID: <BBFC9117.39E8%olb@microscript.com> Date: Wed, 10 Dec 2003 00:00:07 -0800 References: <2cce0284.-1@webx.la2eafNXanI> Lines: 38 User-Agent: Microsoft-Entourage/10.0.0.1309 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit