Re: Quark 6.5 Insert text into insertion point Broken?
Re: Quark 6.5 Insert text into insertion point Broken?
- Subject: Re: Quark 6.5 Insert text into insertion point Broken?
- From: Hans Haesler <email@hidden>
- Date: Wed, 16 Feb 2005 16:01:27 +0100
On Wed, 16 Feb 2005, Jason Bourque wrote:
>This puts the special character at the beginning of the text box not where
>the insertion point is. I don't have any thing selected. Thanks for the
>help.
If you don't have anything selected then your script generates
an error message.
If you select the target box (manually or by script) _and_ if you
use 'contents' (instead of 'text') then it works as expected.
Please make a new project, make a text box, type some text and place
the insertion point somewhere in the middle of the line. Unselect
the box and select the item tool (just to make it harder :-).
Then run this script:
---
tell document 1 of application "QuarkXPress 6.5"
set vTargetBox to text box 1
end tell
set vSpecialCharList to ¬
{"° = Degrees", "Ý = Cross", "\" = Inch Mark", "¢= Cents"}
tell application (path to frontmost application as text)
try
set vSpecialCharacter to character 1 of item 1 of (choose from list ¬
vSpecialCharList default items (item 1 of vSpecialCharList) ¬
without multiple selections allowed) as string
on error
return
end try
end tell
tell document 1 of application "QuarkXPress 6.5"
activate
set selected of vTargetBox to true
set tool mode to contents mode
set contents of selection to vSpecialCharacter
end tell
---
Please note that you must select the box before the tool mode is set.
In other words, the script would fail with grouped boxes ...
Regards,
Hans
---
Hans Haesler <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden