Re: QuarkXPress: Script crashes: why?
Re: QuarkXPress: Script crashes: why?
- Subject: Re: QuarkXPress: Script crashes: why?
- From: Shane Stanley <email@hidden>
- Date: Sat, 17 Feb 2001 08:25:58 +1100
On 17/2/01 6:48 AM +1000, Michael Turner, email@hidden, wrote:
>
The following snip crashes my Quark:
>
>
tell application "QuarkXPress 4.1"
>
activate
>
try
>
set first character of text of story 1 of text box
>
"FredTheBox" of current spread
>
to "<ELEMENT=" & elementString & "a" & ">" &
>
return & first character of text of
>
story 1 of text box "FredTheBox" of current spread
>
set last character of text of story 1 of text box "FredTheBox"
>
of current spread
>
to last character of text of story 1 of text box "FredTheBox"
>
of current spread & addString
>
on error
>
display dialog "Script Broke!"
>
end try
>
end tell
>
>
-- error crashes QuarkX, I don't get the "Script Broke!" message
>
>
What did _I_ do?
I don't know exactly why it crashed, but you're doing too much work there.
Try something like this:
set elementString to ""
tell application "QuarkXPress 4.11"
tell document 1
tell text box "FredTheBox" of current spread
set before story 1 to "<ELEMENT=" & elementString & "a" & ">" & return
set after story 1 to "Bit at the end"
end tell
end tell
end tell
--
Shane Stanley, email@hidden