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.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

iMacro script syntax highlighting in Notepad++ editor

by master_jaf on Sat May 17, 2008 8:24 am

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 134973 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">{ } + &lt; = &gt;</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>
User avatar
master_jaf
 
Posts: 6
Joined: Sat May 17, 2008 5:38 am

Re: iMacro script syntax highlighting in Notepad++ editor

by Hannes, Tech Support on Fri Jun 13, 2008 1: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,
Hannes, iOpus Support
Hannes, Tech Support
 
Posts: 2120
Joined: Thu Sep 21, 2006 6:27 am

Re: iMacro script syntax highlighting in Notepad++ editor

by jackmacokc on Tue Jun 17, 2008 1:47 pm

Very cool. Thanks for doing that!
jackmacokc
 
Posts: 9
Joined: Tue Jun 17, 2008 12:07 pm

Re: iMacro script syntax highlighting in Notepad++ editor

by juzamjedi on Mon Jun 23, 2008 11:14 pm

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++
juzamjedi
 
Posts: 17
Joined: Mon Jun 23, 2008 8:19 pm

Re: iMacro script syntax highlighting in Notepad++ editor

by Tech Support on Thu Oct 16, 2008 6:45 am

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 148598 times

ie editor.png
iMacros file in Notepad++ with syntax highlighting
ie editor.png (21.86 KIB) Viewed 148183 times
firefox editor.png
firefox editor.png (45.03 KIB) Viewed 148167 times
User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

Re: iMacro script syntax highlighting in Notepad++ editor

by fshoukin on Mon Dec 15, 2008 8:19 pm

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.
fshoukin
 
Posts: 5
Joined: Tue Dec 09, 2008 1:57 am

Adjusting colors in the XML file

by Hannes, Tech Support on Tue Dec 16, 2008 1: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" />
Hannes, iOpus Support
Hannes, Tech Support
 
Posts: 2120
Joined: Thu Sep 21, 2006 6:27 am

Re: iMacro script syntax highlighting in Notepad++ editor

by Hello 71 on Sun Dec 28, 2008 10:40 am

Does anybody know of a syntax highlighting file for EditPlus?
Hello 71
 
Posts: 101
Joined: Sun Feb 17, 2008 5:06 pm
Location: Toronto, ON, Canada

Re: iMacro script syntax highlighting in Notepad++ editor

by tunaSalad on Fri Jan 23, 2009 11:43 am

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
tunaSalad
 
Posts: 26
Joined: Mon Jul 07, 2008 9:24 am

Re: iMacro script syntax highlighting in Notepad++ editor

by burgess89 on Wed Feb 18, 2009 4:15 am

What a wicked piece of software, thanks for posting :mrgreen:
burgess89
 
Posts: 5
Joined: Wed Feb 18, 2009 2:55 am

Re: iMacro script syntax highlighting in Notepad++ editor

by Tech Support on Mon Mar 16, 2009 1: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 141703 times

The same editor will be available for the other iMacros versions in the near future, too.
User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

Re: iMacro script syntax highlighting in Notepad++ editor

by bramos on Wed Apr 15, 2009 8:24 am

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...
bramos
 
Posts: 1
Joined: Wed Apr 15, 2009 8:19 am

Re: iMacro script syntax highlighting in Notepad++ editor

by Tech Support on Tue May 26, 2009 3:48 pm

Thanks for asking. The "Save As" feature is there :)
saveas.png
saveas.png (25.56 KIB) Viewed 135766 times
User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

Re: iMacro script syntax highlighting in Notepad++ editor

by CoachMitch on Mon Aug 24, 2009 1: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 7:34 am

Re: iMacro script syntax highlighting in Notepad++ editor

by CoachMitch on Mon Aug 24, 2009 2: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.
CoachMitch
 
Posts: 2
Joined: Mon Aug 24, 2009 7:34 am

Next

Return to General Support & Discussions

Who is online

Users browsing this forum: Google [Bot] and 3 guests

-->