Quark Data Merge
Quark Data Merge
- Subject: Quark Data Merge
- From: Paul Abney <email@hidden>
- Date: Thu, 19 Jul 2001 11:00:21 -0500
I have an Applescript from Sal Soghoian that I have modified to merge data
into a Quark document. So far so good. The following script works fine:
tell application "FileMaker Pro"
if (exists document 1) is false then return
set the_number_of_records to the count of records of document 1
end tell
tell application "QuarkXPress 4.1"
if (exists document 1) is false then return
set the_template_file to the file path of document 1
end tell
repeat with i from 1 to the_number_of_records
try
tell application "FileMaker Pro"
tell document 1
set the_customer to cell "CUSTOMER" of record i
set the_company to cell "company" of record i
set the_address to cell "address" of record i
set the_city to cell "city" of record i
set the_state to cell "state" of record i
set the_zip to cell "zip" of record i
end tell
end tell
tell application "QuarkXPress 4.1"
activate
tell document 1
set (every text of every story where it is "~customer~") to
the_customer
set (every text of every story where it is "~company~") to
the_company
set (every text of every story where it is "~address~") to
the_address
set (every text of every story where it is "~city~") to
the_city
set (every text of every story where it is "~state~") to
the_state
set (every text of every story where it is "~zip~") to
the_zip
if i is less than the_number_of_records then
set thenewpage to make new page at end
show thenewpage
end if
end tell
end tell
end try
end repeat
beep 3
However this script has to look at every story on every page of the Quark
document. So thought I would modify it further so that it only looks on the
current page as the following:
tell application "FileMaker Pro"
if (exists document 1) is false then return
set the_number_of_records to the count of records of document 1
end tell
tell application "QuarkXPress 4.1"
if (exists document 1) is false then return
set the_template_file to the file path of document 1
end tell
repeat with i from 1 to the_number_of_records
try
tell application "FileMaker Pro"
tell document 1
set the_customer to cell "CUSTOMER" of record i
set the_company to cell "company" of record i
set the_address to cell "address" of record i
set the_city to cell "city" of record i
set the_state to cell "state" of record i
set the_zip to cell "zip" of record i
end tell
end tell
tell application "QuarkXPress 4.1"
activate
tell document 1
set (every text of every story of the current page where it
is "~customer~") to the_customer
set (every text of every story of the current page where it
is "~company~") to the_company
set (every text of every story of the current page where it
is "~address~") to the_address
set (every text of every story of the current page where it
is "~city~") to the_city
set (every text of every story of the current page where it
is "~state~") to the_state
set (every text of every story of the current page where it
is "~zip~") to the_zip
if i is less than the_number_of_records then
set thenewpage to make new page at end
show thenewpage
end if
end tell
end tell
end try
end repeat
beep 3
The above script however does not work. What, pray tell, am I doing wrong?
Thanks
Paul Abney
East Memphis Printing
--
Good health is merely the slowest possible rate at which one can die.