How to Increment the TAG position automatically

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
zzzzzz
Posts: 1
Joined: Tue Feb 24, 2009 11:05 am

How to Increment the TAG position automatically

Post by zzzzzz » Tue Feb 24, 2009 11:47 am

Hi All,

I am not able to increment the tag postion automatically.

Suppose I run iMacro in one system which is having a list of size 2
say:
userName Address Action
---------------------------------------
AAA adress1 Update | Delete
BBB adress2 Update|Delete

So if we run an iMacro for the above in my system i can insert update and delete the values
correctly.But if we run it on other machine with a list size of 4 ,iMacro will insert correctly but will
update /delete the record in position 2.Is there any solution for this ? how to increment the TAG POS based
on the size of the list ,which is coming from the database.

Below is the code for the TAG:

TAG POS=3 TYPE=A ATTR=TXT:Update
TAG POS=3 TYPE=A ATTR=TXT:Delete

Can any one help on this issue.
rakhee
Posts: 5
Joined: Tue Feb 24, 2009 12:53 pm

How to Increment the TAG position automatically

Post by rakhee » Tue Feb 24, 2009 1:02 pm

Hi All,

I am not able to increment the tag postion automatically.

Suppose I run iMacro in one system which is having a list of size 2
say:
userName Address Action
---------------------------------------
AAA adress1 Update | Delete
BBB adress2 Update|Delete

So if we run an iMacro for the above in my system i can insert update and delete the values
correctly.But if we run it on other machine with a list size of 4 ,iMacro will insert correctly but will
update /delete the record in position 2.Is there any solution for this ? how to increment the TAG POS based
on the size of the list ,which is coming from the database.

Below is the code for the TAG:

TAG POS=3 TYPE=A ATTR=TXT:Update
TAG POS=3 TYPE=A ATTR=TXT:Delete

Can any one help on this issue.
Marcia, Tech Support

Re: How to Increment the TAG position automatically

Post by Marcia, Tech Support » Tue Feb 24, 2009 3:37 pm

Hello,

Can you post the URL of the web page?

In order to increment the tag position automatically, you can use a loop as in POS={{!LOOP}}.

Does it solve your problem?
rakhee
Posts: 5
Joined: Tue Feb 24, 2009 12:53 pm

Re: How to Increment the TAG position automatically

Post by rakhee » Thu Feb 26, 2009 6:10 am

Hi Marcia,

Thanks for your suggestion.But how to get the size of the list in the database (mysql) from imacro
before running an insert operation. Then only i can increment the POS by a loop.

Since i will be running an imacro in different machine ,the database will be different ,how to get the size
of the list which is on different machine.


Can you help me out.
mlimroamba
Posts: 5
Joined: Fri Feb 01, 2013 9:28 pm

Re: How to Increment the TAG position automatically

Post by mlimroamba » Wed Feb 06, 2013 2:06 am

NEED HELP

Any script to make {{!loop}} incremental

like 11 as starting number of POS=

then POS=23
35, 47, 59.... and so on till I specify the maximum Pos
like

Code: Select all

var i, retcode, errtext;
i=11;
while (i < 107)
{


extract = iimGetLastExtract();
alert('extract: ' + extract);
retcode = iimPlay('CODE:TAG POS='+i+' TYPE=TD ATTR=TXT:* EXTRACT=TXT');

i+=12;


		if(i >= 107)
		{
		retcode = iimPlay('CODE:SAVEAS TYPE=EXTRACT FOLDER=* FILE=mytabletest_test4.txt');
		}
	
}
NEED HELP
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: How to Increment the TAG position automatically

Post by skippyto » Wed Feb 06, 2013 4:58 pm

You can use XPATH to reach the last address and then choose the next tag you need to use with the relative position (R=1 mean the next tag from my position)

Code: Select all

' Reaching the last update link, use CONTENT=EVENT:MOUSEOVER to click on it
TAG XPATH="id('idOfYourForm')/descendant::a[contains(.,'Update')][last()]" CONTENT=EVENT:MOUSEOVER
' Clicking on the next link just after 
TAG POS=R1 TYPE=A ATTR=TXT:*
Skippyto.
Post Reply