I am trying to format text in a text box in QuarkXPress 3.32r5 using
AppleScript. One of the things that I need to do is right align some of the
copy on a left aligned line of text. Manually, you insert a right indent tab
by typing option-tab to do this, but I can't seem to reproduce it from
AppleScript. I have tried XPress 4.1 too, but it doesn't offer any hints
about how to do it either. Does anyone have any ideas? -JP
Did you ever get a response to this?
A quick glance at the Quark dictionary shows "tab list" as a property of the
paragraph, and "tab record" as four items of information about a tab.
My guess would be to set the tab list to tab records that put the text where
you want them.
--
Dave Glass
dgl...@bigfoot.com
Private responses are OK, but public ones are better.
Nope. That doesn't work. tab list shows the regular tabs, accessed with
the standard tab character. option-tab makes you shoot past any
user-defined tabs and right align at the right margin even when there is
no tab stop defined there.
I just did some playing around in 4.11 and I can't see any way that
Xpress indicates to the scripter that anything is different from when
there is a regular tab there, so I don't think you can script this.
The ascii character that's returned from "contents of character x" is
the same ascii 9 that you get if you reference a standard tab character.
I have no clue how one would script this in Xpress, it may be impossible
short of copying/pasting from a document created by hand. The character
of the option-tab will be preserved when copying that character to
another location, e.g.:
tell application "QuarkXPress 4.11"
tell document 1
--for this test, the only character selected is an option-tab
copy character 1 of selection to end of (story 1 of text box 1)
end tell
end tell
Good luck,
Michael
--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT mic...@bcect.com
> Dave Glass <dgl...@bigfoot.com> wrote:
>
>> On 03/22/02 17:58, in article
>> B8C14B72.1114%jppu...@mailpub.transcontinental.ca, "jp"
>> <jppu...@mailpub.transcontinental.ca> wrote:
>>
>>> Hi!
>>>
>>> I am trying to format text in a text box in QuarkXPress 3.32r5 using
>>> AppleScript. One of the things that I need to do is right align some of the
>>> copy on a left aligned line of text. Manually, you insert a right indent tab
>>> by typing option-tab to do this, but I can't seem to reproduce it from
>>> AppleScript. I have tried XPress 4.1 too, but it doesn't offer any hints
>>> about how to do it either. Does anyone have any ideas? -JP
>
>> My guess would be to set the tab list to tab records that put the text where
>> you want them.
>
> Nope. That doesn't work. tab list shows the regular tabs, accessed with
> the standard tab character. option-tab makes you shoot past any
> user-defined tabs and right align at the right margin even when there is
> no tab stop defined there.
>
> I have no clue how one would script this in Xpress, it may be impossible
> short of copying/pasting from a document created by hand. The character
> of the option-tab will be preserved when copying that character to
> another location, e.g.:
>
> tell application "QuarkXPress 4.11"
> tell document 1
>
> --for this test, the only character selected is an option-tab
> copy character 1 of selection to end of (story 1 of text box 1)
> end tell
> end tell
>
>
> Good luck,
>
> Michael
I don't know what the end result needs to be, but I got the following to put
three words in a text box; word 1 is left justified, word 2 is on the same
line but right justified, and word 3 is on the next line and left justified.
-------------------Begin-----------------
Tell application "QuarkXPress 4.11"
tell front document
tell current box
set story 1 to "test"
set story 1 to (story 1 & tab & "test2")
end tell
set justification of paragraph 1 of story 1 to right justified
set story 1 to (story 1 & return & "test3")
set justification of paragraph 2 of story 1 to left justified
end tell
End tell
-------------------End-------------------
I also did some other, really quick testing, and it looks like Quark will
take everything after the final tab and right justify it. So, given the
following:
Set story 1 to "test" & tab & "test2" & tab & "test3" & return & "test4"
"Set justification of paragraph 1 of story 1 to right justified" would
result in "test1", a tab, "test2", then over on the right edge "test3"
On the next line, against the left edge would be "test4".
Again, I don't know how this fits into the bigger picture for what needs to
be done, but it does seem to fake the option tab behavior.
> On 04/04/02 11:16, in article 1fa4c87.1k7fo8zui3w0hN%mic...@bcect.com,
> "Michael Sullivan" <mic...@bcect.com> wrote:
> > Dave Glass <dgl...@bigfoot.com> wrote:
> >
> >> On 03/22/02 17:58, in article
> >> B8C14B72.1114%jppu...@mailpub.transcontinental.ca, "jp"
> >> <jppu...@mailpub.transcontinental.ca> wrote:
> >>> Hi!
> >>> I am trying to format text in a text box in QuarkXPress 3.32r5 using
> >>> AppleScript. One of the things that I need to do is right align some
> >>> of the copy on a left aligned line of text. Manually, you insert a
> >>> right indent tab by typing option-tab to do this, but I can't seem to
> >>> reproduce it from AppleScript. I have tried XPress 4.1 too, but it
> >>> doesn't offer any hints about how to do it either. Does anyone have
> >>> any ideas? -JP
> >> My guess would be to set the tab list to tab records that put the text
> >> where you want them.
> > Nope. That doesn't work. tab list shows the regular tabs, accessed with
> > the standard tab character. option-tab makes you shoot past any
> > user-defined tabs and right align at the right margin even when there is
> > no tab stop defined there.
> I don't know what the end result needs to be, but I got the following to put
Sort of... It's not the same though, because it depends on the overall
justification of the paragraph. You're exploiting an undocumented
feature (quirk?) where the info aligning at the last tab on the line, if
that tab is a left tab, takes on the justification qualities of the
paragraph, rather than the tab it's supposed to align to. I actually
consider that a bug -- the tab alignment should override paragraph
alignment, but it is occasionally useful. I suppose this is one way it
might be, if used in a context where paragraph alignment doesn't
otherwise matter.
I wonder if that little quirk goes away in v. 5?