Can MS do this?

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
Marc Lindsay
Newbie
Posts: 8
Joined: Wed Dec 26, 2007 12:33 am

Can MS do this?

Post by Marc Lindsay » Wed Dec 26, 2007 3:11 pm

Hey Guys,

About 2 years ago when i was playing around with an Internet macro recorder by one of your competitors (I wont mention the name) I noticed it had a really really cool feature that expanded its use 20 fold.

I am curious if MS has support for this or is going to provide support for this in its MS range.

I couldnt see anywhere where it is mentioned.

Okay said software had a "framework" if you will that you could port into VB and use to activate/run its macro's.

Now each macro was recorded in its own script file (you can do this with ms definately) and then i would create a logical program in VB and then use that to fire off macro's when certain conditions where met.

Can you do this with MS?

use includes or some type of thing within a VB program so that you could have a "smarter" program?

Regards
Marc

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Dec 26, 2007 10:44 pm

You can certainly call Macro Scheduler from a command line with the necessary settings to run a certain macro and pass that macro any necessary variables. Have you tried simply calling an external exe from your VB app?

Marc Lindsay
Newbie
Posts: 8
Joined: Wed Dec 26, 2007 12:33 am

Post by Marc Lindsay » Wed Dec 26, 2007 11:23 pm

Well you could do that.

Butt please correct me if I am wrong here, but you cannot create in the traditional sense, functions within MS, which means if I want to do a series of contained loops, then I need to call goto lines to jump to each part of the code that needs to be executed correct?

Or I need to lock down different "functions" in seperate MS scripts, then create a master macro (which is still not a smart program and would be at a guess a continuous loop waiting to meet a criteria, with which it would then fire off the needed macro include script).

So again it leaves a problem of sure you could call a .exe that you compiled through MS, but that exe is still limited by the constraints of MS.

Which means to be able to function it correctly, I would need to create a exe for every closed function I wanted in MS

Of course this all hinges on if I understand correctly that MS cannot create real functions, only loops and goto's and basic logic such as if statements etc.

Thanks
Marc

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Dec 27, 2007 1:13 am

This sounds like you need to explain what you mean by a function.

VB can call any script that you create in Macro Scheduler. The script can be called as a command line parameter. A compiled script can be called.

The called script will do whatever you define the script to do. Do you want a function to open a web site and fill in fields? How a about sending off an email if some failure condition happens? Or maybe rename some files? Or perhaps do a backup. Or upload some files to a FTP site?

Macro Scheduler can do those and many more things. They could all be considered as functions. If you need a function to "return" a value, that can also be done by having the value created as a file, a registry value, a parameter on a command line for another program, etc.

Macro Scheduler also has VB script built in so that you can use VB, VB Script, and Macro Scheduler together to accomplish almost anything you want to do.

Maybe provide a specific example of what you want to do?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Marc Lindsay
Newbie
Posts: 8
Joined: Wed Dec 26, 2007 12:33 am

Post by Marc Lindsay » Thu Dec 27, 2007 2:21 am

Well I dont really know how to explain what I need other then just showing you an example of how another software does it.

Now let me state right now that I think MS is the most advanced macro creator I have used.

This is what I am talking about when I say support for proper scripting.

http://wiki.imacros.net/Web_Scripting

I understand that is a web macro, but there is no reason why you couldnt do it with any other macro software including MS.

Whilst creating a commandline execution is one way, its a rather hackish way to do it, same with returning the value in a registrykey or a file, again rather hackish but would get the job done.

That is not to take away from your solution Bob, they are great and you have thought outside of the box to provide the work around, for that I am grateful, and you have obviously been using MS much longer then I :)

It would be fantastic to see native support for expanding MS even further then its awesome capabilities.

Regards
Marc

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Thu Dec 27, 2007 3:15 am

just a quick note about your previous text concerning the looping of control within MacroScheduler.

I have dozens of subroutines (SRT>'s in MacroSched lingo) that I keep in my MacroScheduler UI and can very quickly pop them into any code I am creating. Makes for very fast coding and definitely reusable code.

when you create a SRT> then you simply use gosub> and then control passes back to the next line after the gosub> once the SRT> is finished with it's work (provided you don't send control from the SRT> to who knows where, which would be REALLY bad practice, but not prohibited)...

Marc Lindsay
Newbie
Posts: 8
Joined: Wed Dec 26, 2007 12:33 am

Post by Marc Lindsay » Thu Dec 27, 2007 3:47 am

Hey Paul,

Thankyou for that explanation, you pretty much nailed one of the questions I was looking for.

Basically SRT's as you call them, can be closed loops or sections/functions that I want to perform.

Lets say in one section of code I wanted to check for an image, action that image and do xyz, that could be one subroutine.

Then wherever I want to "reuse" that SRT all I need to do in my code is use the goto function to jump and run that code.

then after the code has finished running, it will jump back to where it was previously.

Correct?

Okay so now about my further question. If we are tying all this together using a .net language such as VB, how do I receive information back from anything I activate in the VB program?

How do I know when that program has completed running and the "state" of it.

Is there anything native in MS yet that supports some sort of feedback to this type of thing?

Hopefully others will find this a usefull thread as I have not been able to find any info on it yet through searching :)

Thanks
Marc

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Dec 27, 2007 8:53 am

Paul is referring to Subroutines. SRT marks the start of a subroutine block. Use GoSub (*NOT* Goto) to call them:

GoSub>MySubroutine

..
..
..

SRT>MySubroutine
.. do stuff
END>MySubroutine

___

GoSub calls a subroutine and returns execution to where it was called when it finishes.

See the help file topic GoSub.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Marc Lindsay
Newbie
Posts: 8
Joined: Wed Dec 26, 2007 12:33 am

Post by Marc Lindsay » Thu Dec 27, 2007 1:42 pm

Hi Marcus,

Yeah I did check it out, I was just being lazy with my typing, that will learn me for not typing in full hand.

Yet I still see no answer specifically for the VB support and tie in, only a mention that we can use commandline to activate it if we need too.

I presume this means there is no native support for VB or any other .net language.

In which case does anyone know how we would pass something back from the macro to know that it has completed running?

Regards
Marc

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Dec 27, 2007 1:55 pm

Not quite sure what you mean by "VB Support". There seems to be some confusion in this thread. Macro Scheduler allows you to use *VBScript* in your macros. VBScript is NOT Visual Basic.

If you mean you want to run macros FROM your VB app, then use Shell and run the macro via the command line (or compile the macro to an EXE and shell that). You can pass values IN to said macros/exes using command line parameters. See help file on command line options. Each parm becomes a variable in the script.

To pass stuff BACK I would recommend using environment variables. Use SetEnvVar in your macro and then retrieve those environment values in VB.

Macro Scheduler 10 has an Exit command which allows you to set a return value (number). E.g.:

Exit>0

or

Exit>4535

That value is returned to the calling process. It's a regular exit code.

But, for more complex data, and strings etc, I would use environment variables, which is pretty straightforward.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Marc Lindsay
Newbie
Posts: 8
Joined: Wed Dec 26, 2007 12:33 am

Post by Marc Lindsay » Thu Dec 27, 2007 2:08 pm

Perfect :)

The answer you gave on VB was exactly what I was looking for.

This will help me expand things even further with this application.

Thanks for that
Marc

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts