Re: Creating multiple documents from Excel to Quark 4
Re: Creating multiple documents from Excel to Quark 4
- Subject: Re: Creating multiple documents from Excel to Quark 4
- From: Bill Metzinger <email@hidden>
- Date: Tue, 25 Nov 2003 10:52:47 -0500
On Nov 24, 2003, at 1:00 AM, email@hidden
wrote:
Would it be best to to create a new document for each ad or just
open a template with all the styles already set for each text box.
If anything, at least show some code on how to
open a template in quark w/ AS.
It is faster to have as much on the Quark spread as possible.
I run thousands of QX pages from Excel info. Everything that can be on
the page already is. You can have your script switch masters for other
layout. Keep you QX boxes in order. The front box is box 1. If you have
everything in order you can go thru the spreadsheet and throw the data
into box 1, 2, 3 and so on. It's extremely fast. Here's some excerpts
from what I do to get you started. There's tons missing so you'll need
to just pull out what you can use:
**************
set picklist to {"A-AsAdWhite", "B-AsAdYellow", "C-TPR", "D-SCR",
"E-PP"}
set theList to {"AsAd White", "AsAd Yellow", "TPR", "Single Check
Rebate", "Profit Planner"}
set masterchoice to item thepick of the picklist as text
set masterFile to "Yadda:Yadda:Master"
tell application "QuarkXPress"
activate
repeat
if (count documents) = 0 then
exit repeat
else
close document 1 saving ask
end if
end repeat
end tell
try
get alias masterFile
on error
set masterFile to (choose file with prompt "Where is your 10upSuper
document?" of type {"XDOC", "XTMP"}) as text
end try
tell application "QuarkXPress"
activate
set measurements showing to false--for speed
set p to 1
set bx to 1
set ro to 0
open file masterFile use doc prefs yes remap fonts no
try
set master spread of page 1 of document 1 to masterchoice
end try
tell text box 1 of spread 1 of document 1
try
set font of story 1 to "Helvetica 55 Roman"
set font of story 1 to "Helvetica 65 Medium"
set font of story 1 to "Helvetica 75 Bold"
set font of story 1 to "Helvetica 95 Black"
on error
display dialog "Your fonts aren't cool." & return & "Call Bill to
use this script."
end try
end tell
set view scale of document 1 to fit page in window
set tool mode of document 1 to drag mode
set AppleScript's text item delimiters to ""
set story 1 of last text box of page p of document 1 to (ctr &
kitlable & saledate & " " & zonelist & " " & thelabel) as text
set font of story 1 of last text box of page p of document 1 to
"Helvetica 55 Roman"
set AppleScript's text item delimiters to tab
set size of story 1 of last text box of page p of document 1 to 8
set color of story 1 of last text box of page p of document 1 to
ccolor
set docName to name of document 1
end tell
tell application "Microsoft Excel"
set lastone to (get (Row of (LastCell Range "C6" Direction xlDown)))
repeat with r from 2 to lastone
set linenum to "R" & r
set AppleScript's text item delimiters to " "
set temppage to (get text of (Cell (linenum & "C15"))) as text
set itemnumber to (get text of (Cell (linenum & "C3"))) as text
set AppleScript's text item delimiters to return
set itemnumber to text item 1 of itemnumber
set AppleScript's text item delimiters to " "
set temptxt to (get Formula of (Cell (linenum & "C4"))) as text
set tempprice to (get text of (Cell (linenum & "C5"))) as text
set tempsign to (get text of (Cell (linenum & "C8"))) as text
tell application "QuarkXPress"
tell page p of document 1
set story 1 of text box (1) to temptxt
bla bla bla
**************
I hope this helps more than hurts.
Bill
} Don't be afraid to try something new.
} Amateurs built the ark; professionals built the titanic.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.