Jump to content

calling Menu-Items in Notepad


Recommended Posts

I do not get this ... (i tried it in english and german):

;works
Run("notepad.exe "& @ScriptDir & "\document.txt")

;works not - i get 0
Dim $x = WinMenuSelectItem ( "document.txt - Notepad", "", "&File")
MsgBox(0, "AutoIt", $x)

What do i do wrong?

Greetings, Nils

Link to comment
Share on other sites

Hello :-)

MenuSelecectItem initiates a menu item. It only returns a 1.

0 or 1 afaik and i get 0. im trying to open html/-php...files in notepad and then save them as utf-8.

try this:

Run("notepad")
WinWaitActive("Untitled")
$x = WinMenuSelectItem("Untitled - ", "", "&File", "Page Set&up...")
MsgBox(0, "AutoIt", $x)
sorry, i get still 0 ... any other idea?

Greetings, Nils

Link to comment
Share on other sites

Does the Page Setup screen appear when you run this code? (...)

It worked :-)

i misunderstood "optional" in the

Tutorial

so i removed the "Page Set&up..." in your Example when i translated it into german version ... with it works.

(code in german:)

Run("notepad "& @ScriptDir & "\textdokument.txt")
WinWaitActive ( "textdokument.txt - Editor")
Dim $x=WinMenuSelectItem ( "textdokument.txt - Editor", "", "&Datei", "Speichern &unter...")
;WinMenuSelectItem("Untitled - ", "", "&File", "Page Set&up..." )
MsgBox(0, "AutoIt", $x)

very nice. Thanks a lot.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...