AppleScript页面-获取插入点
我正在尝试在iWorks页面上使用AppleScript fu,并希望在WP文档的插入点插入一个文本框。根据页面字典,有一个叫做插入点的对象,它有一个叫做插入点的元素。然而,我似乎什么也得不到:AppleScript页面-获取插入点,applescript,Applescript,我正在尝试在iWorks页面上使用AppleScript fu,并希望在WP文档的插入点插入一个文本框。根据页面字典,有一个叫做插入点的对象,它有一个叫做插入点的元素。然而,我似乎什么也得不到: tell application "Pages" tell front document -->set properties for text box set needs2Col to false set colHeight to 0
tell application "Pages"
tell front document
-->set properties for text box
set needs2Col to false
set colHeight to 0
if ((count of every item of headerFiles) > 5) then
set needs2Col to true
set boxH to (round ((count of every item of headerFiles) / 2) rounding up) * (font size of bookMarkStyle)
set boxW to 6.5 * 72
set boxX to 72.0
-->all these crash and burn with can't get errors
return insertion point of insertion point
return bounds of last paragraph of body text
-->all these return missing value
return insertion point of last paragraph of body text
return insertion point of body text
end if
end tell
end tell
有人能帮我吗。我只是在寻找插入点的x/y。您可以使用(获取选择)的字符偏移量
来获取选择的开始或插入点的位置
tell application "Pages" to tell document 1
--start of selection
character offset of (get selection)
--end of selection
tell (get selection) to character offset + length
--move the insertion point after the second paragraph
select insertion point after paragraph 2
--move the insertion point to the start of the second page
select insertion point before (paragraph 1 where page number of containing page is 2)
--replace the selected text
set selection to "aa"
--selection as plain text
contents of selection
end tell
你找到这个问题的答案了吗?(获取插入点)我真的不记得了,那是五年前的事了。好吧,谢谢,至少在新版的页面上,这似乎是不可能的。