Hot Topic (More than 10 Replies) Automation by Programming or Macros (Read 1830 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Automation by Programming or Macros
Feb 3rd, 2004 at 10:19pm
Print Post Print Post  
I am just in exploring phase. Did not sit down seriously to complete all the details to move over from Q&A to Sesame yet.  For me, automation is very important as all day I have to repeat the same routine repeatedly. I translated a few database files and came to conclusion that translation is not going to be any problem. What left is to automate the application and merge related applications (databases from Q&A) that need to interact often.

Looking at Macros in Sesame for automation was very discouraging.  It is highly unreliable as the pre-requisite to run the macro successfully is to have the same set up of the tree and other parts of application  as when macro was recorded!!  If one of the trees is collapsed or enlarged, it going to be unpredictable at the best and destructive at the worst.  I did not like the idea of recording the mouse movement and clicks at all. 

Four pages of Documentation of Macros in user guide gave me the idea as to how important macros are going to be in the scope of application development in Sesame.  Most of us here are coming from Q&A for Dos background, where macros is the only way one could automate anything and thinking any other way is kind of anxiety provoking for Q&A users.  Don't we all remember the early demise of Q&A because of its failure to incorporate macros in the windows version? Well, that is what I thought.

But looking at Sesame programming, I am not missing Macros  at all, definitely not in the GUI environment. One can practically do anything and everything after entering a form with programming, what one could do with Macros. So, what left is before you enter the form, that is where macro might play a little role in the present form.

Programming sound intimidating at first for the non-programmer users and neophytes like myself but in Sesame the programming syntax are simple and with debugging tool in the form of writeln feedback window, you take one step at a time until you complete the whole routine. What's more,  there are only a few functions that you have to learn for automation namely, @SelectTreeItem, @Load(saved_spec) in the most part and a few others like @save, @exit etc.. to a lesser extent.

I am posting this with hope that others will share their experiences & insight and it might encourage others to explore this important dimension of application development namely, automation.

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Automation by Programming or Macros
Reply #1 - Feb 3rd, 2004 at 10:45pm
Print Post Print Post  
Quote:
It is highly unreliable as the pre-requisite to run the macro successfully is to have the same set up of the tree and other parts of application  as when macro was recorded!!  If one of the trees is collapsed or enlarged, it going to be unpredictable at the best and destructive at the worst.  I did not like the idea of recording the mouse movement and clicks at all.


Actually, the state of the command tree is taken into account while recording and playing back macros. Try this: record a macro that selects "Search Menu | Search Commands | Retrieve New Results (F10)" - then go back to the search menu (F7) and close the "Search Commands" branch of the tree and play back your macro. The macro playback knows that you selected a branch that is now collapsed and finds the item anyways.

The macro recorder is not simply recording the position of mouse clicks and keystrokes - as best as it can it tries to figure out what you clicked on - in case it moves (like scrolling) or is collapsed (like a command tree item), and then find it again on playback.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Automation by Programming or Macros
Reply #2 - Feb 3rd, 2004 at 11:25pm
Print Post Print Post  
Mark, since you know the best, we need to experiment with Macros before writing them off.  Sorry for jumping to conclusion.  Thank you.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Automation by Programming or Macros
Reply #3 - Feb 4th, 2004 at 1:40pm
Print Post Print Post  
SBasic will always have several advantages over macros, chief among them being the ability to change course based on the state of the data. Also, because macros are not "hand editable" they are impossible to alter and must be rerecorded if there is a problem. It is on our "to do" list to provide a "macro language" which can be used to edit macros.

I see a lot of potential, however, in combining macros with SBasic. Macro have the advantage of *not* being attached to a form, and can run before a form has been loaded. They can also be run without a particular event. So I can see a number of applications where a macro opens a form, the event programming in SBasic takes over, and calls small macros chained together using @macro(), while making decisions based on the state of the data.

In the meantime, we also plan to add a number of new automation features in SBasic:

The ability to add/edit the command tree.
Custom buttons and pulldowns in the button bar and menu bar.
Insert keystrokes into the event stream.
Popup forms.
Catching keystrokes

etc...

We are counting on everyone to give us feedback on what sort of features are most wanted.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Automation by Programming or Macros
Reply #4 - Feb 4th, 2004 at 1:56pm
Print Post Print Post  
Quote:
We are counting on everyone to give us feedback on what sort of features are most wanted.

High on that list for me is the ability to manually edit macros.

Sometimes you just need to go in and look at the steps in a macro to remind you exactly what it is doing.  I have macros that were created so long ago that I've forgotten precisely how they are accomplishing the task I set them up for.

PS: A pause for user input (like Q&A has) within a macro is also desirable.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Automation by Programming or Macros
Reply #5 - Feb 4th, 2004 at 2:12pm
Print Post Print Post  
Quote:
We are counting on everyone to give us feedback on what sort of features are most wanted.


My vote is for The ability to add/edit the command tree.

In experimenting with users (small controlled tests) to see how they react to sesame the number one frustration is the command tree. It quickly becomes overwhelming. To be able to thin it out by editing  it would seem helpful.

I have had great results with popup forms in the past. I have been spoiled by John Dows popup forms in his DTFWIN program. The users love them.

Between Subforms on tabs and Popup forms I could have such fun.

With that in mind let me say I am very thankful for the tools that are in Sesame now and each day I learn how to use them better and find something else that amazes me.

Thanks and keep up the great job.  Cheesy
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Automation by Programming or Macros
Reply #6 - Feb 4th, 2004 at 2:43pm
Print Post Print Post  
Quote:
In the meantime, we also plan to add a number of new automation features in SBasic:

The ability to add/edit the command tree.
Custom buttons and pulldowns in the button bar and menu bar.
Insert keystrokes into the event stream.
Popup forms.
Catching keystrokes


All of them will take Sesame to altogether different level. And yes, let us not forget about the inbuilt, well integrated word processor (need not be real fancy). Thank you guys and gals of the Sesame development team. I knew that constant improvement and innovation will chart the further course of development of Sesame.  
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Automation by Programming or Macros
Reply #7 - Feb 6th, 2004 at 8:27pm
Print Post Print Post  
Lately I have been experimenting with Macro facility in Sesame.  In all honesty, I was little biased (kind of Pre-judging) in my opinion about macro use for automating the application. Following are a few of my observations:

1. Macro is an event recorder and not just key recorder. It does not just record the mouse movement. It seems to duplicate the event even when window is minimized or command tree is collapsed.

2. When using the macro on other computer, it did not work. May be it has to do with screen resolution.

3. When command tree was made invisible and any of the event involved command tree clicking, it did not work, unlike @selectTreeItem programming.

4. You would imagine that clicking on one element will make a single event, but no so, sometimes just clicking on couple of elements might end up having several dozens of events. Since, it is not viewable or editable, it is hard to see what events did it record. (There is display of number of events recorded on the button bar.)

5. Unlike in Q&A, you are better of recording only very short macro. Not various chains of events.

6. In spite of everything, it seems to work.

In the present state of Sesame, I will not use macro facility wherever and whenever I can use programming. Probably the automation will involve both programming and Macro.

With the further development and improvement of Macro facilities in terms of being editable and ability to pause will make them a lot more usable.  
  
Back to top
 
IP Logged
 
Justin_ICC
Junior Member
**
Offline



Posts: 95
Joined: Feb 5th, 2004
Re: Automation by Programming or Macros
Reply #8 - Feb 9th, 2004 at 9:22pm
Print Post Print Post  
I definetely like the ability to manually edit macros. In Q&A for DOS I hand wrote about 80% of the macros I used - it allows me to neatly format them and block them logically.

One other feature I'd recommend adding at some point is colourizing the text in the programming windows based on the code (ie if statements are blue, numbers are red, etc. although its probably a huge undertaking, comments being green). This makes it much easier to debug and develop.
  
Back to top
 
IP Logged
 
GJK
Junior Member
**
Offline


Felix qui potuit rerum
cognoscere causas

Posts: 80
Location: Kankakee. Il
Joined: Apr 22nd, 2003
Re: Automation by Programming or Macros
Reply #9 - Feb 9th, 2004 at 10:09pm
Print Post Print Post  
In Q&A there was a default macro "QAMACRO" that loaded when the program was invoked. It could be custom tailored to meet specific needs when opening a database in a specific manner. I would see this as being a good addition to Sesame as it could be cutomized for the unique flavor of each separate database giving each database app a custom look and feel. GK..
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Automation by Programming or Macros
Reply #10 - Feb 9th, 2004 at 10:24pm
Print Post Print Post  
You can invoke a macro on startup using the -macro command line switch:

sesame -macro macro12.mac Customers.db

Of course you can put the command line in the "Target" of an icon. If you want to customize per application, make an icon ("shortcut") for each "customized" application. This can make things a lot easier for newcomers than building a custom form that loads different apps.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged