At 11:10 AM +0900 8/16/03, Nobumi Iyanaga wrote:
Hello,

I wrote a little AppleScript macro that takes the selected text as argument, and returns a tagged text which should replace the selected text. Here it is:

set thetext to ""
tell application "Nisus Writer Express"
        activate
        set thetext to get selected text of document 1
        if thetext is "" then
                return
        end if
        display dialog "Enter the tag name" default answer ""
        set thetag to the text returned of the result
        set the clipboard to "<" & thetag & ">" & thetext & "</" & thetag & ">"
        Do Menu Macro with macro "Edit:Paste"
end tell

This does work well except the last line,

Do Menu Macro with macro "Edit:Paste"

I'm not sure why the line doesn't work, as I don't have NWEx available to test it at the moment.


Do you have System Events in your computer? If so, you could replace "Do Menu Macro with macro "Edit:Paste" with

Tell application "System Events" to tell process "Nisus Writer Express" to click menu item "Paste" of menu "Edit" of menu bar 1

which I think should work.

Best regards,

Jonathan

---------------------------------------------------
The Nisus Interactive List
[EMAIL PROTECTED]

Searchable archives:
http://www.mail-archive.com/nisus-interactive%40nisus.com/

To unsubscribe from this list please send a message with "unsubscribe
nisus-interactive" in the body of the email to [EMAIL PROTECTED]




Reply via email to