Re: QXP Images On Pasteboard?
Re: QXP Images On Pasteboard?
- Subject: Re: QXP Images On Pasteboard?
- From: Hans Haesler <email@hidden>
- Date: Thu, 12 Jul 2001 08:49:39 +0200
On Wed, 11 Jul 2001, Andy Knasinski wrote:
>
Does anyone have a snippet that will return whether an image is on the
>
pasteboard or not? I'm automating some printing and am checking for
>
missing images, etc. but it seems that missing images are OK so as long
>
as they are not in the print image area.
Andy,
the best solution would be to loop through the pages.
This way any images on the pasteboard are ignored.
But to answer your question, the following snippet tells you
if the selected box is on a page or not. It gets the number of
the page on which the box is sitting. If it's on the pasteboard
an error is generated:
---
tell document 1 of application "QuarkXPress 4.11"
try
set pageNum to page number of page 1 of current box
display dialog "This box is on page " & pageNum buttons "OK" default button 1 with icon 1
on error
display dialog "This box is on the pasteboard." buttons "OK" default button 1 with icon 2
end try
end tell
---
BTW, to get the "real" page number (when the Section start has been
modified) you must use this:
---
set pageNum to name of page (page number of page 1) of current box
---
Repeating through all boxes of the document:
---
tell document 1 of application "QuarkXPress 4.11"
repeat with i from 1 to count of picture boxes
try
set pageNum to page number of page 1 of picture box i
--call a handler:
my checkImage(i)
on error
--ignore this box, it is on the pasteboard
end try
end repeat
end tell
on checkImage(i)
--do your stuff (increment a counter when there is a problem)
end checkImage
---
At the end of the script: display a message according to the value
of the counter.
Regards,
Hans
---
Hans Haesler | email@hidden