Quantcast
Channel: Quark Forums
Viewing all articles
Browse latest Browse all 2166

creating guides

$
0
0

Hi Genius,

I am using iMac
Mac OS X - version 10.6.8

Applescript Editor - version 2.3 (118)
Applescript 2.1.2

QuarkXpress - version 8

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 (expected end of line but found "reference") in the below line


set sel to the object reference of selection

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

 

 


Viewing all articles
Browse latest Browse all 2166

Trending Articles