Re: script QXP
Re: script QXP
- Subject: Re: script QXP
- From: Helmut Pfeiffer <email@hidden>
- Date: Thu, 28 Dec 2000 20:58:23 +0100
Hello Luca
thats not the reason why it doesn't work (I checked it out).
I think there is a problem with the topImagePath or with the name and count
of the eps-files. I am a beginner in applescript and have no idea how to
solve the problem with the path to the eps-files.
Mit freundlichen Gruessen
Helmut Pfeiffer
Muenchener Zeitungs-Verlag
>
Von: Luca Pozzato <email@hidden>
>
Datum: Thu, 28 Dec 2000 19:08:19 +0100
>
An: <email@hidden>
>
Betreff: Re: script QXP
>
>
hello Helmut
>
>
The reason why you are getting just "DUMMY.eps" images is because you talk
>
to "picture box 1" twice
>
>
>
>
tell picture box 1
>
try
>
set image 1 of picture box 1 to alias --remove "of picture box 1"
>
topImagePath
>
on error
>
set image 1 to alias (theEPSpath &
>
"DUMMY.eps")
>
end try
>
end tell
>
>
>
Regards
>
Luca Pozzato
>
>
> From: Helmut Pfeiffer <email@hidden>
>
> Date: Thu, 28 Dec 2000 17:19:41 +0100
>
> To: <email@hidden>
>
> Subject: Re: script QXP
>
>
>
> Hello,
>
>
>
> first - thank you very much for your kindly help. I tried to do my stuff
>
> with the hints from Jason, but it doesn't work.
>
> What I have to do are 16 QXP-documents with 32 eps-files (not 16 Pages on
>
> one document). 16 pictures on 8 docs with an angle of 90, 16 with an angle
>
> of -90 and the docs saved with a numbered name. But a look at the script is
>
> perhaps better than my explains:
>
>
>
> Here is my complete script:
>
>
>
> on run
>
> set topNum to 1 as integer
>
> set bottomNum to 32 as integer
>
> set epsBaseName to "Seite " as string
>
> set theEPSpath to "AVNr.1:_test:test1:" as string
>
>
>
> set topNumText to topNum as text
>
> if (count of characters in topNumText) = 1 then
>
> set topNumText to ("0" & topNumText) as string
>
> end if
>
>
>
> set bottomNumText to bottomNum as text
>
> if (count of characters in bottomNumText) = 1 then
>
> set bottomNumText to ("0" & bottomNumText) as string
>
> end if
>
>
>
> set topImagePath to (theEPSpath & epsBaseName & topNumText) as string
>
> set bottomImagePath to (theEPSpath & epsBaseName & topNumText) as string
>
>
>
> tell application "Finder"
>
> activate
>
> set the chosen_folder to (choose folder with prompt "test2")
>
> set theDOCpath to chosen_folder as string
>
> open the chosen_folder
>
> set size of container window of chosen_folder to {230, 360}
>
> set position of container window of chosen_folder to {920, 90}
>
> set view of container window of chosen_folder to name
>
> end tell
>
>
>
> tell application "QuarkXPress"
>
> activate
>
> tell default document 1
>
> set oldHeight to page height
>
> set oldWidth to page width
>
> set oldAutoTextBox to automatic text box
>
> set oldGuidesShowing to guides showing
>
> set xDocMeasure to horizontal measure
>
> set yDocMeasure to vertical measure
>
> set page height to "474 mm"
>
> set page width to "324 mm"
>
> set automatic text box to false
>
> set guides showing to true
>
> set guides in front to true
>
> set horizontal measure to millimeters
>
> set vertical measure to millimeters
>
> end tell
>
>
>
> repeat with n from 1 to 16 by 2
>
> set x to 0 + n
>
>
>
> tell application "QuarkXPress"
>
> make document at beginning
>
> tell document 1
>
> set view scale to fit page in window
>
> end tell
>
> tell page 1 of document 1
>
> make horizontal guide at end with properties
>
> {position:"231 mm"}
>
> make horizontal guide at end with properties
>
> {position:"243 mm"}
>
> tell page 1 of document 1
>
> make picture box at beginning with properties
>
> {bounds:{"0 mm", "0 mm", "231 mm", "324 mm"}, color:"wei_"}
>
> tell picture box 1
>
> try
>
> set image 1 of picture box 1 to alias
>
> topImagePath
>
> on error
>
> set image 1 to alias (theEPSpath &
>
> "DUMMY.eps")
>
> end try
>
> end tell
>
> tell image 1
>
> set angle to 90
>
> set bounds to exact fit
>
> end tell
>
> make picture box at end with properties
>
> {bounds:{"243 mm", "0 mm", "474 mm", "324 mm"}, color:"wei_"}
>
> tell picture box 2
>
> try
>
> set image 1 of picture box 2 to alias
>
> bottomImagePath
>
> on error
>
> set image 1 to alias (theEPSpath &
>
> "DUMMY.eps")
>
> end try
>
> end tell
>
> tell image 2
>
> set angle to 90
>
> set bounds to exact fit
>
> end tell
>
> save document 1 in (theDOCpath & x & "tz0000TZ")
>
> end tell
>
> end tell
>
> end tell
>
> set topNum to (topNum + 1) as integer
>
> set bottomNum to (bottomNum - 1) as integer
>
>
>
> end repeat
>
>
>
> repeat with n from 2 to 16 by 2
>
> set x to 0 + n
>
>
>
> tell application "QuarkXPress"
>
> make document at beginning
>
> tell document 1
>
> set view scale to fit page in window
>
> end tell
>
> tell page 1 of document 1
>
> make horizontal guide at end with properties
>
> {position:"231 mm"}
>
> make horizontal guide at end with properties
>
> {position:"243 mm"}
>
> tell page 1 of document 1
>
> make picture box at beginning with properties
>
> {bounds:{"0 mm", "0 mm", "231 mm", "324 mm"}, color:"wei_"}
>
> tell picture box 1
>
> try
>
> set image 1 of picture box 1 to alias
>
> topImagePath
>
> on error
>
> set image 1 to alias (theEPSpath &
>
> "DUMMY.eps")
>
> end try
>
> end tell
>
> tell image 1
>
> set angle to -90
>
> set bounds to exact fit
>
> end tell
>
> make picture box at end with properties
>
> {bounds:{"243 mm", "0 mm", "474 mm", "324 mm"}, color:"wei_"}
>
> tell picture box 2
>
> try
>
> set image 1 of picture box 2 to alias
>
> bottomImagePath
>
> on error
>
> set image 1 to alias (theEPSpath &
>
> "DUMMY.eps")
>
> end try
>
> end tell
>
> tell image 2
>
> set angle to -90
>
> set bounds to exact fit
>
> end tell
>
> save document 1 in (theDOCpath & x & "tz0000TZ")
>
> end tell
>
> end tell
>
> end tell
>
> end repeat
>
> end tell
>
>
>
> end run
>
>
>
> It works very fine - the docs are saved with the rihgt name but i get
>
> allways the "DUMMY.eps" and not the eps-file i need.
>
>
>
> Mit freundlichen Gruessen
>
>
>
> Helmut Pfeiffer
>
> Muenchener Zeitungs-Verlag
>
>
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users