AutoIt Script - by Yen on Friday, May 16, 2008 14:16 - 5 Comments

Using NotePad++ for AutoIt Scripts

NotePad++ LogoTo use NotePad++ for editing AutoIt3 scripts, we’ll first have to update the NotePad++ API file for AutoIt.

Before we get started, download the latest NotePad++ (I prefer the non-installer zip format) and install/extract NotePad++.

There is actually an AutoIt API file that originally comes with the NotePad++ download but some of the newer functions were not included. To update AutoIt API file:

  1. Backup the original AutoIt API file from [Drive]:\[NotePad Directory]\plugins\APIs\AutoIt.api
  2. Download my updated AutoIt API file and put in into [Drive]:\[NotePad Directory]\plugins\APIs\ overwriting the old file.

The NotePad++ language keyword definition file will also need updating to reflect the new keywords:

  1. Backup the original langs.xml from [Drive]:\[NotePad Directory]\langs.xml
  2. Open the langs.xml file in NotePad++ and add/replace the

    <Language name=”autoit”… </Language>

    section with
    this text (click to open).

NotePad++ also comes with plugins ability, and the more popular plugins were already included with the NotePad++ download. One of these plugins is nppExec, a plugin allowing execution of commands and scripts with the output displayed in a built-in console section. This will the the perfect plugin to run AutoIt commands such as compiling or running the AutoIt script.

To use nppExec, to run the current editing au3 script, go to top menu: ‘Plugins’ > ‘nppExec’ > ‘Execute…’ and fill in the following commands:

cd $(CURRENT_DIRECTORY)
“[PathToAutoItDirectory]\AutoIt3.exe” “$(FULL_CURRENT_PATH)”

Click on ‘OK’ to run the commands. You can also click on ‘Save…’ to save the command with a meaningful name save the hassle of retyping these commands each time it is needed.

Although NotePad++ does comes with a configurable Run menu to run commands, these commands does not show the text returned and thus is not really suitable to for commands such as Au3Check. But we can use this feature for the AutoIt help file.

Go to top menu: ‘Run’ > ‘Run…’ and fill in:

“[PathToAutoItDirectory]\AutoIt3Help.exe” $(CURRENT_WORD)

Click on ‘Save..’ to same the command. Add a keyboard shortcut if you like and that is it. The next time you run this command (either through clicking on the menu or using the shortcut key), AutoIt help will be shown for the matching keyword if available.

  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Live
  • MySpace
  • PDF
  • RSS
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • Ping.fm
  • Propeller
  • Reddit
  • Slashdot
  • Sphinn
  • StumbleUpon

- Written on Friday, May 16, 2008 14:16 - 5 Comments -


5 Comments

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Predator117
May 31, 2008 17:33

Many thanks!
I was searching for an good autoit API for so long. I really enjoy your API and the resulting auto completion, good work!
(sry for my english)

helasz
Jul 10, 2008 17:21

Great! You have saved me a lot of time. Thanks!

thierrybo
Apr 20, 2009 20:15

Hi,

I have no [Drive]:\[NotePad Directory]\plugins\APIs\AutoIt file

Yen
Apr 20, 2009 23:18

Hi thierrybo,

[Drive]:\[Notepad Directory] is the installed directory of Notepad++. By default, the path should be “C:\Program Files\Notepad++” or “C:\Program Files (x86)\Notepad++”.

schnuecks
Aug 7, 2009 17:03

Could you please update the files to the latest version of AutoIt.

Got something to say?

Comment



Archives

Featured Sites

SPCA Loke Yen