Hi,
I want to select/highlight a text after inserting it into current cursor location on a PPT slide. My PowerPoint version is Microsoft PowerPoint for Mac version:16.41. Here is the AppleScript code which inserts text into currently selected text range:
How do I select / highlight the inserted text? In the above code sample it's "CLICK HERE!!!!"
I want to select/highlight a text after inserting it into current cursor location on a PPT slide. My PowerPoint version is Microsoft PowerPoint for Mac version:16.41. Here is the AppleScript code which inserts text into currently selected text range:
AppleScript:
tell application "Microsoft PowerPoint"
activate
tell active window
set txtRnge to get text range of its selection
set cnt to get content of txtRnge
# content is empty
if cnt is equal to "" then
display dialog "empty"
set startRange to get text range of its selection
#content is empty
insert the text "CLICK HERE!!!!" at the end of txtRnge
set endRange to get text range of its selection
# Select / Highlight inserted text
# add hyperlink
set theAction to get text action setting txtRnge
set action of theAction to action type hyperlink action
set hyperlink address of hyperlink of theAction to "http://www.microsoft.com/"
end if
end tell
end tell
How do I select / highlight the inserted text? In the above code sample it's "CLICK HERE!!!!"