Page 1 of 4

iMacro script syntax highlighting in Notepad++ editor

Posted: Sat May 17, 2008 3:24 pm
by master_jaf
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 233690 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>

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Fri Jun 13, 2008 8:39 am
by Hannes, Tech Support
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,

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Tue Jun 17, 2008 8:47 pm
by jackmacokc
Very cool. Thanks for doing that!

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Tue Jun 24, 2008 6:14 am
by juzamjedi
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++

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Thu Oct 16, 2008 1:45 pm
by Tech Support
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 247323 times
iMacros file in Notepad++ with syntax highlighting
iMacros file in Notepad++ with syntax highlighting
ie editor.png (21.86 KiB) Viewed 246908 times
firefox editor.png
firefox editor.png (45.03 KiB) Viewed 246892 times

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Tue Dec 16, 2008 3:19 am
by fshoukin
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.

Adjusting colors in the XML file

Posted: Tue Dec 16, 2008 8:49 am
by Hannes, Tech Support
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" />

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Sun Dec 28, 2008 5:40 pm
by Hello 71
Does anybody know of a syntax highlighting file for EditPlus?

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Fri Jan 23, 2009 6:43 pm
by tunaSalad
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

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Wed Feb 18, 2009 11:15 am
by burgess89
What a wicked piece of software, thanks for posting :mrgreen:

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Mon Mar 16, 2009 8:50 pm
by Tech Support
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 240428 times
The same editor will be available for the other iMacros versions in the near future, too.

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Wed Apr 15, 2009 3:24 pm
by bramos
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...

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Tue May 26, 2009 10:48 pm
by Tech Support
Thanks for asking. The "Save As" feature is there :)
saveas.png
saveas.png (25.56 KiB) Viewed 234491 times

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Mon Aug 24, 2009 8:33 pm
by CoachMitch
: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.

Re: iMacro script syntax highlighting in Notepad++ editor

Posted: Mon Aug 24, 2009 9:35 pm
by CoachMitch
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.