iMacro script syntax highlighting in Notepad++ editor

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
User avatar
master_jaf
Posts: 6
Joined: Sat May 17, 2008 12:38 pm

iMacro script syntax highlighting in Notepad++ editor

Post by master_jaf » Sat May 17, 2008 3:24 pm

If you are editing a lot iMacro scripts by hand, than you will probably wish
that syntax highlighting would be a great idea. So your wishes become true, here it is. :)

Screenshot: of Demo-Loop-Csv-2-Web.iim
notepad++ imacros syntax coloring.png
notepad++ imacros syntax coloring.png (125.85 KiB) Viewed 233709 times
How to install:
1. Of course, first you need Notepad++ editor. Homepage: http://notepad-plus.sourceforge.net/

2. Look for a file "userDefineLang.xml" in example: c:\Documents and Settings\USERNAME\Application Data\Notepad++\userDefineLang.xml (on XP) or c:\Users\USERNAME\AppData\Roaming\Notepad++\userDefineLang.xml (on Vista)

3. If this file does not exists, create it and paste the xml code in
OR
3. If the file exists, edit it and paste the full xml content in.

4. Go to iMacro Settings -> Paths -> External Editor and point it to "notepad++.exe" (usually it is c:\program files\notepad++\notepad++.exe)

Thats it . :D

Important: If you already defined your own user defined language, than you have to merge the xml contents manually, cause Notepad++ does not support such imports right now. :!:

:idea: I've also put a public snippet out there:
http://snippets.dzone.com/posts/show/5511

Code: Select all

<NotepadPlus>
    <UserLang name="IIM" ext="IIM">
        <Settings>
            <Global caseIgnored="no" />
            <TreatAsSymbol comment="no" commentLine="yes" />
            <Prefix words1="no" words2="no" words3="no" words4="yes" />
        </Settings>
        <KeywordLists>
            <Keywords name="Delimiters">000000</Keywords>
            <Keywords name="Folder+"></Keywords>
            <Keywords name="Folder-"></Keywords>
            <Keywords name="Operators">{ } + < = ></Keywords>
            <Keywords name="Comment">1 1 2 2 0&apos;</Keywords>
            <Keywords name="Words1">ADD BACK CLEAR CLICK CMDLINE DISCONNECT DS EXTRACT 
FILEDELETE FILTER FRAME IMAGECLICK IMAGESEARCH ONCERTIFICATEDIALOG ONDIALOG ONDOWNLOAD 
ONERRORDIALOG ONLOGIN ONPRINT ONSECURITYDIALOG ONWEBPAGEDIALOG PAUSE PRINT PROMPT PROXY 
REDIAL REFRESH SAVEAS SET SIZE STOPWATCH TAB TAG URL VERSION WAIT WINCLICK</Keywords>
            <Keywords name="Words2">GOTO T POS TYPE FORM ATTR CONTENT BUILD RECORDER 
EXTRACT CLOSEALLOTHERS FOLDER FILE CLICK X Y CMD STATUS F IMAGE CONFIDENCE C BUTTON 
CONTINUE USER PASSWORD KEYS ADDRESS BYPASS ISP ID SECONDS</Keywords>
            <Keywords name="Words3">!DATASOURCE !DATASOURCE_COLUMNS !DATASOURCE_LINE 
!DIALOGMANAGER !ENCRYPTION !ERRORIGNORE !ERRORMACRO !EXTRACT !EXTRACT_TEST_POPUP 
!EXTRACTADD !EXTRACTDIALOG !FILELOG !FILESTOPWATCH !FOLDERIMACROS !IMAGEX !IMAGEY 
!LOADCHECK !LOOP !MACROTIMEOUT !NOW !POINTER !REPLAYSPEED !SINGLESTEP !STOPWATCHTIME 
!TIMEOUT !URLCURRENT !URLSTART !USERAGENT !VAR1 !VAR2 !VAR3 !VARDEFAULT</Keywords>
            <Keywords name="Words4">!COL</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" 
fontName="" fontStyle="1" />
            <WordsStyle name="KEYWORD2" styleID="6" fgColor="800000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD3" styleID="7" fgColor="8000FF" bgColor="FFFFFF" 
fontName="" fontStyle="2" />
            <WordsStyle name="KEYWORD4" styleID="8" fgColor="8000FF" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT" styleID="1" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" 
fontName="" fontStyle="0" />
        </Styles>
    </UserLang>
</NotepadPlus>
Hannes, Tech Support

Re: iMacro script syntax highlighting in Notepad++ editor

Post by Hannes, Tech Support » Fri Jun 13, 2008 8:39 am

This is actually just what I was looking for when I recently played around with Notepad++'s syntax user defined highlighting. But I would probably never have come near the one you posted.

Thanks a lot!


Best,
jackmacokc
Posts: 9
Joined: Tue Jun 17, 2008 7:07 pm

Re: iMacro script syntax highlighting in Notepad++ editor

Post by jackmacokc » Tue Jun 17, 2008 8:47 pm

Very cool. Thanks for doing that!
juzamjedi
Posts: 17
Joined: Tue Jun 24, 2008 3:19 am

Re: iMacro script syntax highlighting in Notepad++ editor

Post by juzamjedi » Tue Jun 24, 2008 6:14 am

Hello,

On a slight tangent, Notepad++ is available as a portable application. This would enable you to have the syntax highlighting on a USB stick. I have userDefineLang.xml located at:
\PortableApps\Notepad++Portable\App\Notepad++
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: iMacro script syntax highlighting in Notepad++ editor

Post by Tech Support » Thu Oct 16, 2008 1:45 pm

Just a quick note: Notepad++ can be used as default editor in all browsers that are supported by iMacros on Windows (iMacros Browser, Internet Explorer and Firefox).

I made this post sticky because we highly recommend the use of Notepad++ and the syntax file as default editor. After all, we use it ourself :D
editor imacros syntax.png
editor imacros syntax.png (153.15 KiB) Viewed 247342 times
iMacros file in Notepad++ with syntax highlighting
iMacros file in Notepad++ with syntax highlighting
ie editor.png (21.86 KiB) Viewed 246927 times
firefox editor.png
firefox editor.png (45.03 KiB) Viewed 246911 times
fshoukin
Posts: 5
Joined: Tue Dec 09, 2008 8:57 am

Re: iMacro script syntax highlighting in Notepad++ editor

Post by fshoukin » Tue Dec 16, 2008 3:19 am

Hi

In case anyone of you has difficulty locating the exact location of your userDefineLang.xml file, I found out from Notepad++ website that you can do the following to locate that file

1. Get Run Dialog by clicking start->run (Notepad++ should be closed).
2. Copy this text %APPDATA%\Notepad++ into the text field of Run Dialog.
3. Click ok. A folder named "Notepad++" will appear.
4. Save your userDefineLang.xml in that folder.
Hannes, Tech Support

Adjusting colors in the XML file

Post by Hannes, Tech Support » Tue Dec 16, 2008 8:49 am

Thanks, fshoukin! This should come handy for many users.


One more remark:

On my laptop, the dark red of "POS", "GOTO" etc. did not differ much from the black standard color, so I changed the "fgColor" parameter in line 37 to produce a bright red for these keywords:

Code: Select all

<WordsStyle name="KEYWORD2" styleID="6" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" />
Hello 71
Posts: 96
Joined: Mon Feb 18, 2008 12:06 am
Location: Toronto, ON, Canada

Re: iMacro script syntax highlighting in Notepad++ editor

Post by Hello 71 » Sun Dec 28, 2008 5:40 pm

Does anybody know of a syntax highlighting file for EditPlus?
tunaSalad
Posts: 26
Joined: Mon Jul 07, 2008 4:24 pm

Re: iMacro script syntax highlighting in Notepad++ editor

Post by tunaSalad » Fri Jan 23, 2009 6:43 pm

Thanks master_jaff!! It's really handy & looks neat!

I took the licence and made a couple of minor edits in your file.

1. I've added the "OPEN" and "CLOSE" keyword in the "Words2" list
2. Added "&&" and "*" in the Operator list

Dunno if other stuff is missing...

rgds
burgess89
Posts: 5
Joined: Wed Feb 18, 2009 9:55 am

Re: iMacro script syntax highlighting in Notepad++ editor

Post by burgess89 » Wed Feb 18, 2009 11:15 am

What a wicked piece of software, thanks for posting :mrgreen:
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: iMacro script syntax highlighting in Notepad++ editor

Post by Tech Support » Mon Mar 16, 2009 8:50 pm

The new iMacros for Firefox addon contains the new syntax coloring editor:
imacros editor syntax coloring.png
imacros editor syntax coloring.png (81.32 KiB) Viewed 240447 times
The same editor will be available for the other iMacros versions in the near future, too.
bramos
Posts: 1
Joined: Wed Apr 15, 2009 3:19 pm

Re: iMacro script syntax highlighting in Notepad++ editor

Post by bramos » Wed Apr 15, 2009 3:24 pm

As there is no "Save As..." functionality in the new iMacros for Firefox editor (for using an existing Macro as a template to create a new one), I will be sticking with NPP for the time-being...
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: iMacro script syntax highlighting in Notepad++ editor

Post by Tech Support » Tue May 26, 2009 10:48 pm

Thanks for asking. The "Save As" feature is there :)
saveas.png
saveas.png (25.56 KiB) Viewed 234510 times
CoachMitch
Posts: 2
Joined: Mon Aug 24, 2009 2:34 pm

Re: iMacro script syntax highlighting in Notepad++ editor

Post by CoachMitch » Mon Aug 24, 2009 8:33 pm

:D Thank you all for your good efforts and assistance.

My issue is that posts are not complete and therefore, not able to be easily utilized by newbies.

I have just downloaded iMacros - with great anticipation. The instructions said to use Notepad++.

This post showed from where to download Notepad++. I think I did, but I'm not sure. The post, in Item 3, said to find an XML file, which I could not find; or to create an XML file.

How does one create an XML file? I finally found a Google post that said to create an XML file / document in a Text file, but I am dubious.

The post, in Item 4, said to save the XML content into the newly created file. However, I cannot copy the XML content from the PNG image in the post. How does one copy the content of an image?

I predict that the answers will be something simple, however, I also predict that I will not know how to implement the simple fix. I realize that it is not practical for each post to be a complete set of instructions, however, the forum is the only outlet we have. Unfortunately, the iOpus manual seems to be gravely deficient.

Thanks for your time.
CoachMitch
Posts: 2
Joined: Mon Aug 24, 2009 2:34 pm

Re: iMacro script syntax highlighting in Notepad++ editor

Post by CoachMitch » Mon Aug 24, 2009 9:35 pm

Does this forum have an 'edit' function? I would like to edit my last post instead of creating a new one.

In my last post, re the post from master_jaf, in referring to Item 4, it should have been Item 3.

I'm having trouble with Item 4, in that I cannot find "iMacro Settings -> Paths -> External Editor"

BTW, do I understand the Tech Support post of March 16, 09 to mean that the code from master_jaf is no longer needed, that the syntax highlighting is now part of the editor?

If this is so, then the iOpus manual needs to be updated. I have now spent 2 days trying to figure out how to implement this Notepad++ script, to no avail.

Can someone please tell me where to find the info shown by the Tech Support post Oct 16, 08?

Thank you.
Post Reply