Trying to cobble together a handler which will scan thru a Quark doc and check for the existence of a few style sheets.
I run it in a loop. When it finds one missing, the script pops open a dialog saying “the stylesheet x is missing”
What I would like is to somehow keep every dialog box open.
ie
If it finds both stylesheets “header1” and “header3” missing, it will keep a dialog box open for each of them.
tell document 1 of application "QuarkXPress"
activate
set stylshts to {"header1", "header2", "header3"}
repeat with ThisText in stylshts
set ThisText to ThisText as string
if not (exists style spec ThisText) then
display dialog ("You're missing the stylesheet" & return & ThisText) giving up after 1
end if
end repeat
I think I read somewhere that in order to do this I would have to have the Finder be the app displaying the dialogs. Can anyone tell me more?
Why not just one dialog box with all missing style sheets
tell document 1 of application "QuarkXPress"
activate
set stylshts to {"header1", "header2", "header3"}
set missingStylshts to ""
repeat with ThisText in stylshts
if not (exists style spec ThisText) then
set missingStylshts to missingStylshts & return & contents of ThisText
end if
end repeat
if missingStylshts is not "" then
display dialog ("You're missing the stylesheet(s)" & missingStylshts) giving up after 1
end if