Page 1 of 1

I need to error trap if form isnt avail?

Posted: Tue Jun 17, 2008 8:01 pm
by dayv2005
ok i wrote a simple script looks like this

VERSION BUILD=6050529 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=website
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:action ATTR=VALUE:value
REFRESH


Ok this just submits a form. Well sometimes when you log into this site. Sometimes there's a form available and sometimes there isnt a form available.

Well if the form is there this line "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:action ATTR=VALUE:value" executes clean. but if there isnt a form their this line produces an error. is there a way to do an if statement basically if there is an error refresh else execute that line?

Re: I need to error trap if form isnt avail?

Posted: Tue Jun 17, 2008 8:03 pm
by dayv2005
btw teh error is this.

Error# 801 in line:7 , TAG not found

TYPE=INPUT:SUBMIT
FORM=ACTION:"Form action here"
ATTR=VALUE:"Value"

Re: I need to error trap if form isnt avail?

Posted: Tue Jun 17, 2008 8:30 pm
by jackmacokc
dayv2005 wrote:ok i wrote a simple script looks like this

VERSION BUILD=6050529 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=website
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:action ATTR=VALUE:value
REFRESH


Ok this just submits a form. Well sometimes when you log into this site. Sometimes there's a form available and sometimes there isnt a form available.

Well if the form is there this line "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:action ATTR=VALUE:value" executes clean. but if there isnt a form their this line produces an error. is there a way to do an if statement basically if there is an error refresh else execute that line?
Not without scripting. There is no built in logic in iMacros. You'll need to use vbscript or C# and the scripting edition of iMacros in order to do that.

Re: I need to error trap if form isnt avail?

Posted: Tue Jun 17, 2008 11:09 pm
by dayv2005
im a programmer can you point me in the right way for documentation on this? i have vs2005 already so i just need to know api docs if you know where i can read that

Re: I need to error trap if form isnt avail?

Posted: Wed Jun 18, 2008 12:40 pm
by jackmacokc
dayv2005 wrote:im a programmer can you point me in the right way for documentation on this? i have vs2005 already so i just need to know api docs if you know where i can read that
Here's a basic reference: http://wiki.imacros.net/CSharp

You basically add the reference to the dll's to your project and then simply insantiate a new iMacros.App object. Very simple, actually. Let me know if you need any help - it took me awhile to figure it all out myself.

Here's a quick example snippet:

Code: Select all

using System;
using System.Collections.Generic;
using System.Text;
using iMacros;

namespace Test
{
    class Example
    {
        public static void Main()
        {
            App imApp = new App();
            Status imStatus = new Status();

            imStatus = imApp.iimInit("-ie", false, "", "", "", 5);
            imStatus = imApp.iimPlay("macro");
            imStatus = imApp.iimExit()
        }
    }
}

Re: I need to error trap if form isnt avail?

Posted: Wed Jun 18, 2008 1:00 pm
by dayv2005
thanks man i greatly appreciate that. I will try getting around to doing it here soon. Im at work right now and i think they'd be upset seeing me messing around with that haha. But i iwll keep you in mind if i need any help with it.