how to change date to one month back from today using imacro

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
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
satish_k
Posts: 15
Joined: Wed Sep 13, 2006 9:18 am

how to change date to one month back from today using imacro

Post by satish_k » Wed Sep 20, 2006 4:54 am

Hi,
how to change date to one month back from today using imacro.
The code that I have is as follows

VERSION BUILD=5200814
SIZE X=500 Y=500
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://elf.meterpower.co.uk/login.asp
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:groupid CONTENT=<userid>
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:userid CONTENT=<pwd>
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:form1 ATTR=NAME:password CONTENT=<>
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:form1 ATTR=NAME:Enter&&VALUE:Enter
'Comment: New page loaded
WAIT SECONDS=3
URL GOTO=http://elf.meterpower.co.uk/sp_main.asp
CLICK X=100 Y=100
ONDOWNLOAD FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}}
TAG POS=1 TYPE=INPUT:RADIO FORM=NAME:Form1 ATTR=NAME:demcons&&VALUE:KWH CONTENT=KWH
TAG POS=1 TYPE=INPUT:RADIO FORM=NAME:Form1 ATTR=NAME:Consolidate&&VALUE:YES CONTENT=YES
TAG POS=1 TYPE=INPUT:RADIO FORM=NAME:Form1 ATTR=NAME:datestart CONTENT={{!NOW:dd"/"mm"/"yyyy}}

Regards
Satish
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: how to change date to one month back from today using im

Post by Tech Support » Thu Sep 21, 2006 12:59 pm

satish_k wrote: how to change date to one month back from today using imacro.
The code that I have is as follows
Hi,

the macro itself cannot manipulate the date. But if you are calling the macro from a script, you can use the programming language's abilities. Manipulate the date there (in VB.NET is's DateAdd(), in Perl via Date::Manip), pass it to the macro as a variable, and use this variable instead of !NOW.


Best,

Hannes Michalek, iOpus Support
Post Reply