Updated 10/24/05
Scripts for QuarkXpress 6.5
We are in the process of converting from QuarkXpress 4.11 to QuarkXpress 6.5. Below are some AppleScript nuggets that work with 6.5.
Get count of pages
tell document 1 of application "QuarkXPress"
set pageCount to (get count of every page)
close
end tell
Get height of page
tell document 1 of application "QuarkXPress"
set horizontal measure to inches
set vertical measure to inches
set pageheight to page height as inch units as real
end tell
Get width of page
tell document 1 of application "QuarkXPress"
set horizontal measure to inches
set vertical measure to inches
set pagewidth to page width as inch units as real
end tell
Get margins of page
tell document 1 of application "QuarkXPress"
set horizontal measure to inches
set vertical measure to inches
set rightmargin to right margin as inch units as real
set leftmargin to left margin as inch units as real
set topmargin to top margin as inch units as real
set bottommargin to bottom margin as inch units as real
end tell
Close every window
tell application "QuarkXPress"
activate
close every window
end tell
Create and name a text box
--This assumes you pass the values pageWidth, leftMargin, rightMargin to this function
tell document 1 of application "QuarkXPress"
make text box at beginning with properties {bounds:{"-0.028\"", "0.00\"", "p9", (pagewidth - (leftmargin + rightmargin) as inch units)}, name:"dateLineBox"}
end tell
Delete pages
--This assumes you pass the values startpage and endpage to the function
tell document 1 of application "QuarkXPress"
delete (pages startpage thru endpage)
save document 1
end tell
Save pages
--This assumes you pass the value pathAndName to the function
tell application "QuarkXPress"
save document 1 in pathAndName
end tell
Create text in a text box
--This assumes you pass the value yourText to the function, and that the box is named "datelinebox"
tell document 1 of application "QuarkXPress"
set text of text box "dateLineBox" to yourText
end tell
|