Re: Setting Pages Insertion point (was Setting TextEdit S( )
Re: Setting Pages Insertion point (was Setting TextEdit S( )
- Subject: Re: Setting Pages Insertion point (was Setting TextEdit S( )
- From: KOENIG Yvan <email@hidden>
- Date: Thu, 27 Sep 2007 15:54:24 +0200
Le 27 sept. 07 à 14:23, Axel Luttgens a écrit :
On 27/09/07 13:35, KOENIG Yvan wrote:
Hello
As you seems to be mora aware than I am about Insetion points, I
will ccept that my assumption was wrong.
- 1 - what is wrong here:
tell application "Pages" to tell document 1
get properties of insertion point 12 of body text
end tell
which returns: "Erreur dans Pages :
NSReceiverEvaluationScriptError: 4"
Hello Yvan,
You need to use a correct reference form for referencing the
insertion point you are interested in; for example:
tell application "Pages"
tell front document
get properties of insertion point before character 12 of
body text
end tell
end tell
Yes, view like that, scripting appears as a kind of puzzle.
How may I guess that the correct reference is
insertion point before character 12
while
insertion point 11 is a wrong one ?
assuming there are at least 12 characters in the the document.
- 2 -you wrote:
"You might also try setting the
contents of an insertion point."
I tried with:
tell application "Pages" to tell document 1
set contents of insertion point 12 of body text to " truc "
end tell
Well, I'm discovering Pages' scripting thanks to this thread and
thus needed some trials and errors.
Of course, the same as above holds.
Otherwise this one, for example, "works" here:
tell application "Pages"
tell front document
set text of insertion point before character 12 of body text
to "truc"
end tell
end tell
Another example of lying dictionary?
HTH,
Axel
Thanks
Shane's proposal
tell application "Pages"
tell document 1
set contents of insertion point after character 12 of body text to
" truc "
end tell
end tell
don't send an error but does nothing ;-((
Once again, scripting Pages resemble to a puzzle.
I asked here before I was aked myself by a Pages user.
In fact at this time I'm mainly searching the oddities striking in
localized Numbers.
Back to Pages, when I read in the dictionary:
insertion point n [inh. item] : location between two characters
I assumes that I may grab them or the items whose insertion points
inherit.
get insertion points of body text
returns {missing value}
while
get items of body text
returns:
"Erreur dans Pages : Impossible de transformer every item of body
text of document 1 en type reference."
So, I'm a bit annoyed.
Yvan KOENIG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden