Using Windows Task Scheduler you can completely automate iMacros, you can setup your script to run whenever you want without having to manually start it. You can choose the time and day for the script to play plus you can have it play repeatedly for example daily, once a week, even have it play multiple times a day.

Follow these steps:

1. Create a .bat file on your desktop and paste the code in below. (Download .bat file)

**This file is a small program that will open firefox and play an imacros script.@echo off
start firefox.exe -P default -no-remote imacros://run/?m=ADDMEFAST/AMF-Master.js

Notice the highlighted parts in the code:
First highlighted part put the name of the firefox profile to open, (Leave as default if you only have 1 profile)
Second part highlighted put the name of the iMacros script you want to play.

2. Click on Create Basic Task in Windows Task Scheduler, follow the steps and use the new .bat file you just created.

create imacros basic task

task scheduler bat file

3. Make sure the exit firefox option in script is marked as yes if you are using one of my scripts.

imacros exit firefox

NOTE: If you aren’t using one of my scripts then add code to the end of your script to close firefox if you plan on having the task scheduler run your script more than once. Check cheatsheet below for the code.

Checkout imacros wiki for the full command reference.
IMACROS COMMAND REFERENCE MEANING:
URL GOTO=https://imacropro.com go to website
SET !TIMEOUT_PAGE 15 set time limit on waiting for a page to load (number signifies seconds)
SET !TIMEOUT_STEP 0 remove time on waiting for a element to be found (by default it waits up to 6 seconds)
SET !ERRORIGNORE YES ignore errors
SET !EXTRACT_TEST_POPUP NO disable the extract testing popup
SET !DATASOURCE C:\imacros\imacropro.csv set location of csv file in computer
SET !DATASOURCE_LINE 1 set the line of data to use from csv file
SET !VAR1 EVAL(“var randomNumber=Math.floor(Math.random()*20 + 1); randomNumber;”) returns random number between 1-20
FILEDELETE NAME=C:\imacros\imacropro.csv delete any file from your computer
SET !USERAGENT “Mozilla/1.22 (compatible; MSIE 10.0; Windows 3.1)” set browser useragent
PROXY ADDRESS=192.1.8.1:8080 set proxy
URL GOTO=javascript:window.scrollBy(0,-20000) scroll up
URL GOTO=javascript:window.scrollBy(0,20000) scroll down
TAB CLOSEALLOTHERS close all tabs in browser except the current active tab
TAB OPEN open new tab in browser
TAB CLOSE close current tab in browser / close firefox
WAIT SECONDS=2 wait seconds, (replace with any number even half sec are fine e.g. 2.5)
REFRESH refresh current window (same as pressing F5)
CLEAR clear browser cache and cookies
BACK visit previous website/page
PAUSE pause script
SET current {{!NOW:mm-dd-yyyy-hh:mm}} Get current date and time
CONTENT=EVENT:MOUSEOVER hover over element instead of clicking e.g. TAG POS=1 TYPE=A ATTR=TXT:TUTS CONTENT=EVENT:MOUSEOVER
SEARCH SOURCE=REGEXP:”([\\s\\S]*)” EXTRACT=”$1″ extract page source code
SET !VAR2 EVAL(“‘{{!EXTRACT}}’.trim()”) Trim leading and trailing spaces from extract with eval javascript
SET !EXTRACT NULL clear extract
SET title {{!EXTRACT}} set extract to a custom variable
SAVEAS TYPE=EXTRACT FOLDER=* FILE=extracted-data.csv save extracted data
Checkout w3schools for the full JavaScript string reference. Click here for Regex Cheatsheet
JAVASCRIPT IMACROS COMMAND REFERENCE MEANING:
iimPlay(macro); play a macro
iimDisplay(“Display some text”); display text on bottom left corner of screen
iimDisplay(“Current loop: “+ i); display loop number
var lastExtract = iimGetLastExtract(); turn last extract to a variable.
var error = iimGetLastError(); turn the last error description to a variable
window.scrollBy(0,-20000) scroll up
window.scrollBy(0,20000) scroll down
window.close(); close tab/firefox
Math.floor((Math.random() * 7) + 5); Return a random number between 5 and 12
iimPlay (“CODE:WAIT SECONDS=0.5”); Play imacros code in .js script

SUCCESS! Your script will now automatically play at the time and day you specified as long as your computer is on.

OPTIONAL

– Minimize Firefox

If you want the firefox browser to be minimized when scripts play automatically you can download the addon Minimize On Start and Close. This addon will automatically minimize the firefox browser on startup so that automated scripts don’t disturb you when you are using your computer.

After installing addon, click Options and set the settings as shown below.
minimize firefox