Page 1 of 1

Scripting bug in Quark 9.5.4.1?

Posted: 06 Aug 2014, 10:33
by davidp-c
Hi all,

I'm seeing what looks like a bug in Quark 9.5.4.1.

The following script runs fine:

Code: Select all

tell application "QuarkXPress"
	set s to style sheet of paragraph 1 of story 1 of document 1
end tell
But running this (very similar) script causes Quark to crash:

Code: Select all

script theRealScript
	tell application "QuarkXPress"
		set s to style sheet of paragraph 1 of story 1 of document 1
	end tell
end script

tell application "QuarkXPress"
	do script {theRealScript}
end tell
I've attached these scripts and a sample document for testing. I'd appreciate knowing if others can reproduce this problem or if it's something wrong with my setup...

Note that it seems to be something about accessing the "style sheet" property of a paragraph. Other properties (like "leading" for example) can be substituted in the scripts above, and then both scripts work.

Re: Scripting bug in Quark 9.5.4.1?

Posted: 07 Aug 2014, 02:32
by Jean-Marie Schwartz
The same here! :?

Re: Scripting bug in Quark 9.5.4.1?

Posted: 07 Aug 2014, 07:38
by Sirish Nair (Quark)
davidp-c wrote:Hi all,

I'm seeing what looks like a bug in Quark 9.5.4.1.

The following script runs fine:

Code: Select all

tell application "QuarkXPress"
	set s to style sheet of paragraph 1 of story 1 of document 1
end tell
But running this (very similar) script causes Quark to crash:

Code: Select all

script theRealScript
	tell application "QuarkXPress"
		set s to style sheet of paragraph 1 of story 1 of document 1
	end tell
end script

tell application "QuarkXPress"
	do script {theRealScript}
end tell
I've attached these scripts and a sample document for testing. I'd appreciate knowing if others can reproduce this problem or if it's something wrong with my setup...

Note that it seems to be something about accessing the "style sheet" property of a paragraph. Other properties (like "leading" for example) can be substituted in the scripts above, and then both scripts work.
Hi David,

Calling of script is not correct.
Incorrect calling:
script theRealScript
tell application "QuarkXPress"
set s to style sheet of paragraph 1 of story 1 of document 1
end tell
end script

tell application "QuarkXPress"
do script {theRealScript}
end tell

Correct calling:
script theRealScript
tell application "QuarkXPress"
set s to style sheet of paragraph 1 of story 1 of document 1
end tell
end script

tell application "QuarkXPress"
run script theRealScript
end tell

~Sirish

Re: Scripting bug in Quark 9.5.4.1?

Posted: 07 Aug 2014, 07:47
by Jean-Marie Schwartz
Hi Sirish! On the other hand that's how it is stated in the Apple Events Scripting reference guide (PDF, p. 11) shipping with QuarkXPress.
COMPILE SCRIPTS
Using the do script event sends a compiled script directly to QuarkXPress
where it is pro cessed completely within the application before anything
appears on-screen.
Add the following lines to AppleScript scripts to have them automatically
compile and execute within QuarkXPress:
script theRealScript
tell application "QuarkXPress"
--the script goes here
end tell
end script
tell application "QuarkXPress"
do script {theRealScript}
end tell

Re: Scripting bug in Quark 9.5.4.1?

Posted: 13 Aug 2014, 00:26
by Sirish Nair (Quark)
Hi David/ Jean- Marie,

Did the script with do command ever work at your end in QXP 9.5?

~Sirish

Re: Scripting bug in Quark 9.5.4.1?

Posted: 13 Aug 2014, 03:04
by QuarkXPressUser
Sirish Nair (Quark) wrote:Did the script with do command ever work at your end in QXP 9.5?
Did you check leading? davidp-c said it in very first post:
"Note that it seems to be something about accessing the "style sheet" property of a paragraph. Other properties (like "leading" for example) can be substituted in the scripts above, and then both scripts work"

Re: Scripting bug in Quark 9.5.4.1?

Posted: 02 Sep 2014, 07:40
by Jean-Marie Schwartz
Sirish Nair (Quark) wrote:Hi David/ Jean- Marie,

Did the script with do command ever work at your end in QXP 9.5?

~Sirish
Hi Sirish! Yes it worked perfectly indeed! Thanks for the input!
Yet I come accross other issues with raw data such as in the following code:

Code: Select all

script theRealScript
	tell application "QuarkXPress"
		tell document 1
			set the_height to height of text of the selection -- hauteur en points (font units : "9 pt")
			set the_width to width of text of the selection -- largeur du texte en millimètres
			set the_baseline to baseline of text of the selection -- position de la ligne de base par rapport au haut du bloc (4,238 mm")
			--set vert_offset to baseline offset of text of the selection
			set hor_offset to offset of text of the selection -- position du 1er caractère du texte par rapport à tout le texte du bloc
			set the_ascent to ascent of text of the selection
			set the_box_pos to properties of current box
			return {the_height, the_width, the_baseline, hor_offset, the_ascent, the_box_pos}
		end tell
	end tell
end script

tell application "QuarkXPress"
	set {H, W, B, O, A, P} to run script theRealScript
end tell
Any lights on that? I know that by coercing data one can get sth more interesting but prior to upgrading to Mountain Lion I never came accross that. What's the reason? How to handle that easily?