iMacros for Chrome

From iMacros
Revision as of 17:53, 16 May 2018 by Mf (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Thank your for using iMacros for Chrome, the open-source web automation solution.

License

iMacros for Chrome End User License Agreement

Installation

Firefox Download the latest version of iMacros for Chrome from the Chrome webstore

No administrative rights are required for the installation. All versions of Chrome (Win, Mac and Linux) are supported.

This installer corresponds to the free version which can be used for non-commercial purposes to record and replay small macros stored as bookmarks. Some iMacros for Chrome features are only available with a Personal Edition (or higher) license. This includes file access to play macro files, read/write CSV files, and other extended functionality as detailed in the table below:

Feature Free edition Paid version (any) Affected commands
Play macros Only as bookmarks, up to 50 lines. As bookmarks and files, any length
Record macros Only as bookmarks, up to 50 lines As bookmarks and files, any length
Save macros Only as bookmarks As bookmarks and files
Read input from CSV files No Yes !DATASOURCE
Save extracted data to file No Yes SAVEAS, SAVEITEM
Make screenshots of webpage No Yes SCREENSHOT, SAVEAS
Save stopwatch data to a file No. Data can still be referenced in macro via the !STOPWATCHTIME variable Yes !FILESTOPWATCH, !FOLDER_STOPWATCH
Profile macro performance No Yes !FILE_PROFILER

If you want to use iMacros for Chrome in your business or would like to store macros as regular text files to exchange them across other versions of iMacros (Firefox, iMacros Browser, iMacros for IE), read/write CSV files, and other extended functionality, you will need iMacros File Access. Purchase any iMacros license and download the latest File Access for iMacros Extensions module from your Ipswitch account. Current iMacros customers with an active service agreement already have access to this module.

Add File Access

iMacros for Chrome looks the file access module installed. Once it is installed, you will see the familiar treeview there.

Important: iMacros File Access is only available for Windows. Currently we do not offer a version for Mac or Linux.

Download the installer from your Ipswitch Community account

  • Login to your account
  • Select My Products
  • Select your license
  • Click the Download link to download the installer for the File Access module.
  • After installing, the File Access module will automatically detect whether there is an iMacros license on the machine and only prompt you to enter your activation code if necessary


Download from Ipswitch Community account

First Steps

After you installed iMacros for Chrome you will see the iMacros icon in the toolbar. First we recommend that you look at a few demo macros. After this start recording your first own macro. To get start, a simple website like this wiki or our company website are a good start. To record, open the iMacros panel and click record. When you are done recording, click the stop icon either in the panel or in the Chrome toolbar. The iMacros icon changes to a stop button with line counter during recording and replay.

The iMacros for Chrome Panel: You can start playing macros either from the iMacros panel or from your bookmarks or macros that are embedded into websites.
The iMacros icon changes to a stop button with line counter during recording and replay. The WAIT command displays the wait time as countdown.


The iMacros panel has a loop button to run macros repeatedly. This can be useful for checking a certain web page status or for web testing. While the loop is running, the current loop number is stored in the !LOOP internal variable.

Example usage: Create a macro that refreshes the current page every 5 seconds:

 VERSION BUILD=1031208 RECORDER=CR
 REFRESH
 WAIT SECONDS=5
Start the PAGE REFRESH macro with the LOOP button.

Tips for using iMacros for Chrome freeware

Some of iMacros functionality is now only available with a paid license. These are features we believe are most likely to be used in a business environment and should not affect hobby users of iMacros for Chrome.

Because we think there is still a lot of value in the freeware, we would like to give you a few tips to overcome some of the limitations, if you would like to keep using the freeware for your personal tasks.

  1. Existing macro files can easily be copied to bookmarks through the clipboard: open the macro file in any text editor, copy its contents to the clipboard and paste over an existing bookmark macro which is open in the macro editor. If you do not have any bookmark macro, start recording to create one. Use SaveAs to save with a new name.
  2. Long macros can be divided in smaller chunks and played one after the other. Just be aware that variables and macro settings are reset after each play.
  3. Besides the 3 user variables (!VAR1, !VAR2, and !VAR3), the !EXTRACT macro variable can also be used to "park" values. Or one can make use of an auxiliary html file loaded in a Chrome tab. A dummy form like in http://demo.imacros.net/Automate/AutoDataEntry might be all you need.
  4. To input data from CSV files, use an html file with a table where your data is displayed on a Chrome tab, see below. Tag the table elements from that tab instead of reading from a file. Excel can save a worksheet (an imported CSV file) to html.

 <html>
 <head>
   <style>
       .table
       {
           width: 100%
       }
       .row .cell
       {
           padding: 5px;            
           border: 1px solid black;
       }
       
   </style>
   <script>
       window.onload = function () {
           var datasource = document.getElementById('datasource');
           datasource.addEventListener('change', function (e) {
               var csvFile = datasource.files[0];
               var fileReader = new FileReader();
               fileReader.onloadend = function (e) {
                   var table = document.getElementById('table');
                   var lines = fileReader.result.split(/\r?\n/);
                   var n = 0;
                   lines.forEach(function (line) {
                       n++;
                       var tr = document.createElement("tr");
                       tr.setAttribute("class", "row");
                       tr.setAttribute("id", "row_" + n);
                       var cells = line.split(/,/);
                       var m = 0;
                       cells.forEach(function (cell) {
                           var td = document.createElement("td");
                           m++;
                           td.setAttribute("id", "cell_" + n + "-" + m);
                           td.setAttribute("class", "cell");
                           var text = document.createTextNode(cell);
                           td.appendChild(text);
                           tr.appendChild(td);
                       });
                       table.appendChild(tr);
                   });
               }
               fileReader.readAsText(csvFile);
           }, false);
       }
   </script>
 </head>
 <body>
    Select CSV file:
    <input type="file" id="datasource" />
    <div>Table with loaded CSV file:</div>
    <table id="table" class=table></table>
 </body>
 </html>

iMacros as Bookmarklets

You can rename, edit or delete your iMacros via the the Chrome bookmark manager


If you are used to other iMacros versions, you might be surprised that iMacros for Chrome does not store its macros as text files. The reason for this is that Chrome extensions can not access the file system. Instead we store macros as bookmarklets inside the regular Chrome bookmarking system.

As the macros are packed as bookmarklets, you can just drag & drop them to your bookmarks folder or bookmarks bar. This means you can take full advantage of the Chrome syncing to have your macros synced across computers. You can sync your iMacros macros just like normal bookmarks. And with the iMacros secure password encryption that means that you can even store login macros securely in the cloud.


Social Scripting

Users can embed the complete macro in a simple link that can be shared with friends and coworkers. Users can also embed the link on their homepage, blog and company Intranet. In this way, users can help website visitors perform certain tasks. Instead of telling visitors how to fill out a form, users can let iMacros fill out the form for them. All information is stored inside the link as a text string, and nothing is stored on our servers.

For example, click on this link to search for available flights at orbitz.

Important: Make sure the embedded macro is url-encoded using e.g. this tool.

Tip: To send macros (bookmarklets) by email, use the a link shortener service.

Command Line Support

The Google Chrome API does not provide command line information for extensions yet, but user "cammarin" suggested a great way to use iMacros for Chrome via the command line: Embed the iMacros bookmarklet in a local web page.

  1. Make sure that "Allow access to file URLs" is enabled for the iMacros extension as shown here.
  2. Create a bookmark for the macro you want to launch
  3. Right-click on the bookmark in Chrome (not in the iMacros sidebar) and select Edit
  4. In the URL field, copy the value of the e_m64 variable, e.g. everything between quotes where you see: var e_m64 = "..."
  5. Paste this value in place of the corresponding value for var e_m64 in the HTML file shown below

Example:

 <html>
     <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">

        <script>
           var e_m64 = "UFJPTVBUJTIwSEVMTE8hJTBBVVJMJTIwR09UTyUzRGh0dHAlM0ElMkYlMkZpbWFjcm9zLm5ldCUyRiUwQVBST01QVCUyMEJZRSE";
        </script>

        <a id="criimlaunch" href="javascript:(function() {try{if(!/^(?:chrome|https?|file)/.test(location)){alert('iMacros: Open webpage to run a macro.');return;}
           var macro = {};macro.source = decodeURIComponent(atob(e_m64));macro.name = 'MacroBookmarklet';
           var evt = document.createEvent('CustomEvent');evt.initCustomEvent('iMacrosRunMacro', true, true, macro);
           window.dispatchEvent(evt);}catch(e){alert('iMacros Bookmarklet error: '+e.toString());}}) ();">Launch CR iMacros</a>

     </body>
 </html>

Example command line / batch file:

 "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" file:///D:/web/test.htm

"test.htm" is the local webpage with the bookmarklet.

Alternatively, you can embed the macro source code directly into the HTML file and skip the process of creating a macro bookmark altogether (special thanks to forum user iimfun for this solution!):

<html>
   <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">

      <script>
         var macroCode = '';
         macroCode += 'PROMPT HELLO!\n';
         macroCode += 'URL GOTO=http://imacros.net/\n';
         macroCode += 'PROMPT BYE!\n';

         function launchMacro()
            {
            try
               {
                  if(!/^(?:chrome|https?|file)/.test(location))
                  {
                     alert('iMacros: Open webpage to run a macro.');
                     return;
                  }
			   
                  var macro = {}; 
                  macro.source = macroCode;
                  macro.name = 'EmbeddedMacro';
			   
                  var evt = document.createEvent('CustomEvent');
                  evt.initCustomEvent('iMacrosRunMacro', true, true, macro);
                  window.dispatchEvent(evt);
               }
            catch(e)
            {
               alert('iMacros Bookmarklet error: '+e.toString());
            };
         }
      </script>

      <a id="criimlaunch" href="javascript:launchMacro();">Launch CR iMacros</a>

   </body>
</html>

Related forum post: How to run a macro from the command line using Chrome

Scripting Chrome

Google Chrome, the complete browser, can be scripted with the iMacros Scripting Interface (API) included with some of the iMacros paid editions. The API allows you to control Chrome from external programs (C++, C#, Python, Perl,...). For details, see the chapter with the iimOpen command.

Using Chrome with the iMacros RunAs Agent (iimRunner)

  1. iimRunner only works with a non-default Chrome UserDataDir (aka profile)
  2. Make sure the iMacros add-on is installed in the new user profile.
  3. In order to launch Chrome with a different user profile via the iMacros scripting interface (e.g. iimOpen("-cr -crUserDataDir C:\MyProfile")) or with iimRunner (e.g. iimOpen("-cr -runner -crUserDataDir C:\MyProfile")), you need to allow access to file URLs:
    1. In the Chrome menu, go to More tools - Extensions and find iMacros in the list of extensions
    2. Make sure "Allow access to file URLs" is checked
:::
Allow access to file URLs (with border).png

Where is the iimDisplay message?

Due to Chrome's UI, we opted to show messages output by iimDisplay as a desktop notification pop-up window.

In iMacros for Chrome, if the sidebar is not available (e.g. if you start the browser from scripting interface API or run macros from bookmarks menu) errors and iimDisplay() messages are shown in a desktop notification pop-up window.

Getting Help

If you run into any issues, please don't hesitate to contact us on our support forum. Take a quick look through the forum before asking your question, we might already have a solution or work around available.

Known Issues

Current known issues with the latest version of iMacros for Chrome:

Version History

Read what's new:

  • 2018-05-16 V10.0.2 Download now
    • Fixed: iMacros panel (sidebar) not opening when Chrome is set to "Continue where you left off"


  • 2017-12-14 V10.0.1
    • New: Freeware and Personal version
    • New: new color and icons, modern and clean design
    • New: File upload support
    • Added: replay speed control to the iMacros Settings
    • Added support for the !PLAYBACKDELAY command
    • Added a read-only !FOLDER_MACROS and !FOLDER_DOWNLOAD command to specify the directory for saving macros
    • Added Help button onto Manage tab
    • Changed minimum Chrome version to v.51
    • Fixed an issue while reading a macro file with certain number of bytes
    • Fixed no timeout for TAG command that results in #EANF#
    • Fixed an iMacros hang-up while attempting to access a non-existing datasource file
    • Fixed a hang-up while attempting to switch to a non/existent tab
    • Fixed not displaying the file tree if it contains more than 27 items
    • Fixed recording special characters in Event recording mode
    • Fixed missing selection of highlighted macro in the files tree
    • Fixed not using IDs as selectors while recording
    • Fixed Drag & Drop functionality in the iMacros files tree
    • Fixed ignoring timeout values caused due to SET !ERRORIGNORE YES
    • Fixed the display of the SaveAs editor dialog
    • Removed 'Experimental' for Recording mode from the Settings page


  • 2016-06-20 V8.4.4
    • Added: new recording mode EVENT
    • Added: TAG SELECTOR command, to localize element using CSS selectors
    • Several bug fixes


  • 2016-04-28 V8.3.5
    • Fixed: support for Chrome v49


  • 2015-07-23 V8.3.4
    • Fixes several reported issues with automating file downloads
    • New: Automate file downloads in Chrome - We added support for ONDOWNLOAD !!!


  • 2014-05-28 V8.07
    • New: Chrome V35 bug workaround
    • New: New Scripting interface, workaround for Chrome's block of NPAPI dlls - requires separate installer.

Due to Chrome restrictions, the updated extension only supports macros inside bookmarks. For file access, please install our new file access modules - get them at iMacros_for_Chrome#Installation.


  • 2014-03-10 V7.03
    • Fixed: Shrinking sidebar bug (only Linux systems affected). This fix is actually a workaround for a Chrome bug.


  • 2014-03-10 V7.02
    • New: Significantly improved UI
    • New: Upload support for AlertFox Website Monitoring
    • Fixed: Many smaller bug fixes and tweaks


  • 2013-07-05 V6.06
    • New: New indicator for the recording/replay position
    • Improved: Bookmarklet conversion
    • Fixed: Many smaller bug fixes and tweaks

Important note for iMacros Enterprise Edition users: The updated iMacros Chrome Scripting Interface requires iMacros V9.02 or this patch. After downloading the patch, unzip and run "install.cmd" as administrator. It updates the Chrome connector to the latest version. This patch supports both, iMacros 8 and 9.

V6.06 features the new floating iMacros icon...(also in the new iMacros for Firefox)



  • 2012-10-08 V5.21
    • Added: ONERRORDIALOG
    • Added: EVAL
    • Added: Performance log feature
    • Added: SET !FILE_PROFILER
    • Improved: iimTakeBrowserScreenshot support
    • Improved: Bookmarklets support - now iMacros for Chrome and iMacros for Firefox bookmarklets have the same format.
    • Fixed: MAC Chrome compatibility issues introduced by Chrome V22
    • Fixed: BACK button not recorded
    • Fixed: Many smaller bug fixes



  • 2012-04-24 V5.01
    • Added: FRAME support
    • Added: SAVEAS support
    • Added: EVAL support
    • Added: Support for TIMEOUT_PAGE and TIMEOUT_MACRO
    • Improved: iMacros Chrome icon is changed only on those windows where replaying or recording happens
    • Fixed: Negative counter issue
    • Fixed: Several smaller bug fixes


  • 2012-02-09 V4.01
    • Added: Visual display for recorded commands
    • Added: Visual display for replayed commands
    • Added: iimDisplay support
    • Improved: Web Scripting Interface: control Chrome with iimInit ("-cr").


New visual display for recording and replay
iMacros for Chrome can store macros as text files (fully compatible with iMacros for IE and Firefox) and also embeded them inside bookmarks - perfect for quick access and syncing macros with your bookmarks. Use the macro storage option to switch.


  • 2011-07-15 V3.5.3
    • Added: Re-added support for iMacros in bookmarks
    • Added: Conversion of macros between "stored as local file" and "stored as bookmarks". Bookmark storage is great for automated syncing.
    • Added: Double treeview - view macros stored as files and in bookmarks.


  • 2011-05-05 V3.5.1 Beta
    • Added: Mac OSX support!
    • Added: Improved iimInit ("-cr") support


  • 2011-01-20 V3.0.2 Beta


  • 2010-05-20 V2.0.1 Beta
    • Added: Read/write/edit standard text based iMacros macro files ("*.iim" files).
    • Added: Drag & Drop tree view
    • Added: Run more than one instance (requires Google Chrome V5.x)
    • Fixed: Several minor issues


  • 2010-02-08 V1.1.1
    • Added: !CLIPBOARD command: SET !CLIPBOARD "Hi" works, but {{!CLIPBOARD}} does not currently work due to a bug in Chrome.
    • Added: Macro edit, rename and delete with right-click
    • Added: STOPWATCH - Result is written to Chrome Javascript Console
    • Fixed: Several minor issues




  • 2009-12-5 V1.0.0
    • Added: Improved GUI, panel now stays open during record and replay
    • Added: Pause button
    • Added: LOOP button & {{!LOOP}} variable
    • Added: REFRESH
    • Fixed: Several smaller issues


  • 2009-12-1 V0.6.5
    • Added: Line numbers and WAIT time in seconds are displayed as text in the browser action icon
    • Fixed: Another page load timing issue


  • 2009-11-30 V0.6.1
    • Fixed: Page load timing issue



  • 2009-11-23 V0.5.0
    • Added: Browser Action support
    • Fixed: Encoding issue for Non-ASCII characters in macro. Bookmarklets now Base64 encoded.
    • Fixed: Several smaller issues


  • 2009-10-01 V0.3.2
    • Added: Initial release

See Also

iMacros for Firefox