Firefox Browser batch plugin IMacros

Source: Internet
Author: User

Http://www.360doc.com/content/14/1012/19/4360822_416372016.shtml

JavaScript section

var code = "Code:";

var jslf = "\ n";

Code + = "URL GOTO = http://www.youdomain.com/" + jslf;

Code + = "URL GOTO = http://www.youdomain2.com/";

Iimdisplay ("IIM script starts running!"); Display status text

Iimplay (code); Run the script

Variable 1:

IMacros can record your actions on a Web page, and then simulate your actions to automatically repeat the execution. The advanced application mainly lies in two aspects:

1. Use JS dynamic call, repeated execution.

2. Call the CSV file, this is good oh.

You can also call the database, which is useless.

Installation and Firefox general expansion of the installation method, will not install Google, after installation click on the IMacros button, the browser appears on the left side of its work interface, on three parts:

1. Run: (can run the existing macro, do not explain, do not be afraid of the very useful)

2. Record: (Point record can record your action in the webpage, press stop can automatically save as current macro)

3. Edit: (You can further edit the stored macro, more suitable for your purpose)

IMacros variable

Divided into system default variables and user-defined variables

First, the system default variables

There are three special variables in the system's default variables: VAR1 VAR2 VAR3 can give any value.

Common in-System variables:

SET! VAR1 Hello<sp>world
Set! VAR1 for Hello World (PS: <sp> for Space <br> for carriage return)

SET! Timeout 25 Macro Timeout value

PROMPT Pleaseentertext! VAR1
An input box pops up and the content you enter in the input box will be uploaded! The VAR1.

User-defined variables: Variables that are passed in from outside the user

Iimset ("Myurl", "www.google.com")

Use {{Myurl}} when calling variables

Variable two:

The function used by JS to invoke IMacros

One, Iimplay (): Call a IIM script.

The full invocation method is: int ret_code = Iimplay (String macro [, int timeout]), and the return value Ret_code to 1 indicates that the IIM was called correctly. Less than 0 indicates an error occurred while executing the script.

To fulfill the IMacros script statement, the statement can be a paragraph, must be CODE: Start, between the lines with "\ n" separated, the return value is negative for the performance of the wrong

Second, Iimset (): Set Custom variables

The syntax is: int ret_code = Iimset (String-var_varname, String varvalue)

The most important is the above two, but also to understand

Iimdisplay (msg): Displays a message as a standalone dialog box

String=iimgetlastextract ([n]): Returns the nth data obtained from the page via extract

Iimgetlasterror () returns the error message corresponding to the most recent error (string)

When Tag is not found, it will wait by default! TIMEOUT/10 so often, the default value is 6 seconds.

Calling a CSV file

CmdLine! DATASOURCE Sliyu.csv
SET! Datasource_columns 8
SET! LOOP 2
SET! Datasource_line {{! LOOP}}

SET! DATASOURCE Sliyu.csv (built-in variable!) DATASOURCE)
SET! Datasource_columns 8 (after selecting the data source file we need to tell the Imacroscsv file how many columns there are.) Use! Datasource_columns variable setting)
SET! LOOP 2
SET! Datasource_line {{! Loop}} (since we want to insert all the datasets we need to control the macro loop.) Ps:loop is the number of times the script loops, remember the loop run button on the play loop, the built-in variable is used to set the first line of the read file. )

Now, we've done all the preparation work. Next we will read out the corresponding data.
TAG type=input:text form=listing attr=name:name content={{! COL1}}
TAG type=input:text form=listing attr=name:album content={{! COL2}}
TAG type=input:text form=listing Attr=name:price content={{! COL3}}
{{! COL1}} represents the first column of data to be read out

Common directives

Refresh for refreshing the page

Wait secondes=3 wait 3 seconds

Ondialog Pos=1 button=cancel content= See pop-up window after click CANCEL

URL goto=http://www.g.cn go to URL www.g.cn

tab T=1 go to the first tab page

VERSION build=6700624 Recorder=fx
Version number

TAG Pos=1 type=td Attr=align:center extract=txt
Pos= Status Page Extract content type= label attr= Tag Pair Property: Value Extracrt=txt Extract text

SET! VAR {{! EXTRACT}} Extract content in EXTRACT, copy to Var

SET! Timeout 25 Timeout Time setting value

SET! Replayspeed fast is used to set the playback speed to the fastest, that is, the execution of the statement is not waiting

SET! Errorignore YES to ignore mistakes

Firefox Browser batch plugin IMacros

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.