I use this script to create monthly flyers in which the names of the month and the colors has to be changed.
It lets the user choose an item of a list and the script then uses other corresponding items to perform its tasks.
--Name of color spec (Monthcolor) supposed to be in your QuarkXpress document; spot color.
property basicMonthColor : "MonthColor"
--Text to replace with the new month
property ChangeMonth : "ChMonth"
--Corresponding PantoneColor for each Month (short name and long name).
property MonthColorlist : {¬
{"januari", "Orange 021", "PANTONE Orange 021 C"}, ¬
{"februari", "Red 032", "PANTONE Red 032 C"}, ¬
{"maart", "Process Cyan", "PANTONE Process Cyan C"}, ¬
{"april", "354", "PANTONE 354 C"}, ¬
{"mei", "Process Magenta", "PANTONE Process Magenta C"}, ¬
{"juni", "Orange 021", "PANTONE Orange 021 C"}, ¬
{"juli", "Orange 021", "PANTONE Orange 021 C"}, ¬
{"augustus", "Orange 021", "PANTONE Orange 021 C"}, ¬
{"september", "Red 032", "PANTONE Red 032 C"}, ¬
{"oktober", "Process Cyan", "PANTONE Process Cyan C"}, ¬
{"november", "354", "PANTONE 354 C"}, ¬
{"december", "Process Magenta", "PANTONE Process Magenta C"}}
--Make the list with months to choose from.
set Monthlist to {}
repeat with thisItem in MonthColorlist
set end of Monthlist to item 1 of thisItem
end repeat
--Userchoice: which month to produce
set newMonth to (choose from list Monthlist with prompt "Which month to make?" without multiple selections allowed) as text
if (newMonth is "false") then error number -128
repeat with i from 1 to count of MonthColorlist
if newMonth is (item 1 of item i of MonthColorlist) then
set newMonth to (item 1 of item i of MonthColorlist)
set theNewColor to (item 2 of item i of MonthColorlist)
set theNewColorName to (item 3 of item i of MonthColorlist)
end if
end repeat
--Tell Quark to replace the text "ChMonth" with the name of the new month
--Then change the corresponding spotcolor.
tell application "QuarkXPress Passport"
activate
tell document 1
set every text of every story where it is ChangeMonth to newMonth
--Change Pantone of Month color
set short name of color spec basicMonthColor to theNewColor
set long name of color spec basicMonthColor to theNewColorName
set name of color spec basicMonthColor to theNewColorName
end tell
end tell