Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create guides in that tab positions

Engaged ,
Oct 05, 2019 Oct 05, 2019

Hi Genius,

 

I am using iMac

Mac OS X - 10.12.6

 

Applescript Editor - Version 2.9 (191)

 

Applescript 2.5

 

QuarkXpress - QuarkXPress 2017

 

Jean-Marie Schwartz has wrote the below AS to find the tab positions in a paragraph and to create guides in that tab positions.

 

While I compile the script, it shows the syntax error as “error Can’t make text from character 1 to character 65536 of story 1 of current box of document 1 of application \"QuarkXPress 2017\" into type Unicode text." number -1700 from text from character 1 to character 65536 of text flow 1 of «class CUBX» of document 1 to Unicode text”

 

Can anyone help me to fix this?

 

 

Below AS for your reference:

 

property ParagraphReturn : "

"

 

tell application "QuarkXPress"

tell document 1

set sel to the object reference of selection

set the_offset to offset of sel

if the_offset > 0 then

set the_text to (text from character 1 to character the_offset of story 1 of current box) as Unicode text

set oldDelims to AppleScript's text item delimiters

set AppleScript's text item delimiters to {ParagraphReturn}

set my_number to number of text items in the_text

set AppleScript's text item delimiters to oldDelims

else

set the_offset to (65536 + the_offset)

set the_text to (text from character 1 to character the_offset of story 1 of current box) as Unicode text

set oldDelims to AppleScript's text item delimiters

set AppleScript's text item delimiters to {ParagraphReturn}

set my_number to number of text items in the_text

set AppleScript's text item delimiters to oldDelims

end if

set {T, L, B, R} to bounds of current box as list

tell story 1 of current box

set the_paragraph_properties to properties of paragraph my_number

end tell

set the_tab_list to tab list of the_paragraph_properties

repeat with i from 1 to length of the_tab_list

set the_position to position of item i of the_tab_list

set the_position to ((the_position as number) + (L as number)) as vertical measurement

my CreateVerticalGuide(the_position)

end repeat

my Bip(2)

end tell

end tell

 

on Bip(x)

tell me to beep x

end Bip

 

on CreateVerticalGuide(guide_position)

tell application "QuarkXPress"

tell document 1

tell current page

make vertical guide at beginning with properties {position:guide_position}

end tell

end tell

end tell

end CreateVerticalGuide

 

Thanks,

Prabu G

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.
TOPICS
Scripting
855
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 06, 2019 Oct 06, 2019

Hahaha! QuarkXPress!? Aren't you a bit confused posting that here... 

Translate
Community Expert ,
Oct 06, 2019 Oct 06, 2019

Hahaha! QuarkXPress!? Aren't you a bit confused posting that here... 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Oct 06, 2019 Oct 06, 2019
LATEST

Jean-Marie post occassionaly at the Quark forum:

https://forums.quark.com/index.php

 

and at the QuarkXPress closed Facebook group, another person (Espen) who is versed in QXP + AppleScript posts there frequently:

https://www.facebook.com/groups/quarkxpress/

 

Mike (who doesn't know AS as I use Windows)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines