T
teacherpoet
Version: 2008
Operating System: Mac OS X 10.4 (Tiger)
Processor: intel
Trying to get an Applescript I used in Mariner Write to work in Word '08 . . .
tell application "Microsoft Word"
if front document exists then
tell front document
copy LineIndex of selection to currentLine
copy (count of lines) to numLines
set dialogPrompt to "Go to Line (Range 1.." & (numLines as string) & ")"
display dialog dialogPrompt default answer currentLine buttons {"Cancel", "OK"} default button "OK"
if button returned of result is "OK" then
set currentLine to ((text returned of result) as integer)
if currentLine ≥ 1 and currentLine ≤ numLines then
--select character (offset of line currentLine)
--the first character of the line
--select line currentLine
--select the line
--select insertion point (offset of line currentLine)
--place the insertion point at the beginning
else
display dialog ¬
"Line index does not exist." buttons {"OK"} default button "OK" with icon note
end if
end if
end tell
else
display dialog ¬
"There is no active document." buttons {"OK"} default button "OK" with icon note
end if
end tell
What am I doing wrong?
Operating System: Mac OS X 10.4 (Tiger)
Processor: intel
Trying to get an Applescript I used in Mariner Write to work in Word '08 . . .
tell application "Microsoft Word"
if front document exists then
tell front document
copy LineIndex of selection to currentLine
copy (count of lines) to numLines
set dialogPrompt to "Go to Line (Range 1.." & (numLines as string) & ")"
display dialog dialogPrompt default answer currentLine buttons {"Cancel", "OK"} default button "OK"
if button returned of result is "OK" then
set currentLine to ((text returned of result) as integer)
if currentLine ≥ 1 and currentLine ≤ numLines then
--select character (offset of line currentLine)
--the first character of the line
--select line currentLine
--select the line
--select insertion point (offset of line currentLine)
--place the insertion point at the beginning
else
display dialog ¬
"Line index does not exist." buttons {"OK"} default button "OK" with icon note
end if
end if
end tell
else
display dialog ¬
"There is no active document." buttons {"OK"} default button "OK" with icon note
end if
end tell
What am I doing wrong?