title: Using WSH (VBS) with iMacros - how do they do it?
body: <p>(iMacros For Firefox 6.6.5.0; Firefox 3.6.3; Windows XP Pro SP3 w/all updates)</p>
  
  <p>I made an iMacro to select "load next 25" (comments) on a web page (CNN.COM). Unfortunately, iMacros doesn't appear to do looping (do the above until that string doesn't appear on the page anymore - i.e. all the comments are loaded). I tried putting {!iloop} in the TAG command, and it didn't work - then I read it wouldn't.</p>
  
  <p>So I tried the example at <a href="http://wiki.imacros.net/Loop_after_Query_or_Login" rel="nofollow noreferrer">http://wiki.imacros.net/Loop_after_Query_or_Login</a>
  I can't find any information on how to actually run the script in the above example. I searched Google and found VBS scripting is handled with .wsh files with Windows XP Pro. (The examples and other references there say Windows does VBS natively, so I looked up how with Google.)</p>
  
  <p>So I made the following .wsh file (modified the above example):   </p>
  
  <pre><code>Option Explicit
  Dim iim1, iret
  
  'initialize iMacros instance
  set iim1 = CreateObject ("imacros")
  iret = iim1.iimInit()
  
  do while not iret &lt; 0
     iret = iim1.iimPlay("Load All CNN Comments")
  loop
  
  ' tell user we're done
  msgbox "End."
  
  ' exit iMacros instance and quit script
  iret = iim1.iimExit()
  Wscript.Quit()   
  </code></pre>
  
  <p>Here's the iMacro: (Load All CNN Comments.iim)   </p>
  
  <pre><code>VERSION BUILD=6650406 RECORDER=FX
  TAG POS=1 TYPE=A ATTR=TXT:Load&lt;SP&gt;next&lt;SP&gt;25
  WAIT SECONDS=#DOWNLOADCOMPLETE#   
  </code></pre>
  
  <p>The iMacro works by itself - I press Play (left iMacro panel) and the next 25 comments load on the CNN.com page in the current tab.</p>
  
  <p>I put the .wsh file in the ...\iMacros\Macros directory - with the iMacro "Load All CNN Comments.iim"</p>
  
  <p>When I run the .wsh file (by just double clicking on it's icon - I created it with Notepad, and Windows gave it an icon for that file type - it's executable) I get the message from "Windows Script Host" - "There is no script file specified." I wasn't actually expecting it to work, as I don't see how Windows would know to call iMacros to run the iim macro.</p>
  
  <p>It would be nice if there was a simple, COMPLETE, example of how to use a VBS script with iMacros, that isn't bogged down with unnecessary complication like filling in a form, loading multiple pages, etc. I can't find ANY example.</p>
  
  <p>So what do I need to do to get this to work? I just installed iMacros yesterday, because I am constantly having the problem that there are hundred of comments after a CNN.com article, and loading 25 more at a time until they are all on the page makes it impractical to read any replies to my comments.</p>
  
  <p>It would also be nice if I could run the Macro from Firefox, rather than by double clicking on some file somewhere.</p>
  
  <p>Thanks for any help. </p>