Scripting bug in Quark 9.5.4.1?

Discuss AppleScripting for QuarkXPress 10, 9 & 8 (and before)

Scripting bug in Quark 9.5.4.1?

Postby davidp-c » 06 Aug 2014, 10:33

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.
Attachments
testing.zip
Sample files to reproduce the bug described in the post.
(18.2 KiB) Downloaded 421 times
davidp-c
 
Posts: 5
Joined: 08 May 2012, 08:08

Re: Scripting bug in Quark 9.5.4.1?

Postby Jean-Marie Schwartz » 07 Aug 2014, 02:32

The same here! :?
Jean-Marie Schwartz

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.10.5 • QuarkXPress 9.5.4.1 + QuarkXPress 2017 • Adobe CS5 =
Jean-Marie Schwartz
 
Posts: 2499
Joined: 23 Nov 2004, 04:30

Re: Scripting bug in Quark 9.5.4.1?

Postby Sirish Nair (Quark) » 07 Aug 2014, 07:38

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
Sirish Nair
Senior Technical Lead, Quality Assurance
QUARKXPRESS PUBLISHING R&D (INDIA) PVT. LTD.
A-45, Industrial Area, Phase 8-B, Mohali, Punjab, India Pin: 160059
sinair@quark.com | http://www.quark.com

Image
User avatar
Sirish Nair (Quark)
Quarkian
Quarkian
 
Posts: 579
Joined: 15 Mar 2005, 09:57
Location: India

Re: Scripting bug in Quark 9.5.4.1?

Postby Jean-Marie Schwartz » 07 Aug 2014, 07:47

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
Jean-Marie Schwartz

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.10.5 • QuarkXPress 9.5.4.1 + QuarkXPress 2017 • Adobe CS5 =
Jean-Marie Schwartz
 
Posts: 2499
Joined: 23 Nov 2004, 04:30

Re: Scripting bug in Quark 9.5.4.1?

Postby Sirish Nair (Quark) » 13 Aug 2014, 00:26

Hi David/ Jean- Marie,

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

~Sirish
Sirish Nair
Senior Technical Lead, Quality Assurance
QUARKXPRESS PUBLISHING R&D (INDIA) PVT. LTD.
A-45, Industrial Area, Phase 8-B, Mohali, Punjab, India Pin: 160059
sinair@quark.com | http://www.quark.com

Image
User avatar
Sirish Nair (Quark)
Quarkian
Quarkian
 
Posts: 579
Joined: 15 Mar 2005, 09:57
Location: India

Re: Scripting bug in Quark 9.5.4.1?

Postby QuarkXPressUser » 13 Aug 2014, 03:04

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"
QuarkXPressUser
 
Posts: 157
Joined: 20 Oct 2008, 23:49

Re: Scripting bug in Quark 9.5.4.1?

Postby Jean-Marie Schwartz » 02 Sep 2014, 07:40

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?
Jean-Marie Schwartz

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.10.5 • QuarkXPress 9.5.4.1 + QuarkXPress 2017 • Adobe CS5 =
Jean-Marie Schwartz
 
Posts: 2499
Joined: 23 Nov 2004, 04:30


Return to QuarkXPress 8, 9 & 10: AppleScript

Who is online

Users browsing this forum: No registered users and 1 guest

cron