Normal Topic Can Sesame "monitor" a folder? (Read 1230 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Can Sesame "monitor" a folder?
Mar 12th, 2004 at 10:44pm
Print Post Print Post  
Is there a way to have Sesame watch a certain folder and autorun a batch file or program when a file has been created or modified?

This would be great with our POS system. As soon as we "hotsync" our scanner, the .txt file full of barcoded items would be saved then sesame will open an invoice to start reading the .txt file.

Any thoughts?

Thanks!
Steve in Texas.

Ps. If its allowed, I'll post all my programming to the Programming examples board when its all up and running.
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Can Sesame "monitor" a folder?
Reply #1 - Mar 12th, 2004 at 11:00pm
Print Post Print Post  
Quote:
Ps. If its allowed, I'll post all my programming to the Programming examples board when its all up and running.

Allowed and strongly encouraged!  Grin
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Can Sesame "monitor" a folder?
Reply #2 - Mar 12th, 2004 at 11:01pm
Print Post Print Post  
There is the @fileExists function that can be used to check if a file by a particular name has come into existence. Only reading it will tell you if it has been modified.
  

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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Can Sesame "monitor" a folder?
Reply #3 - Mar 12th, 2004 at 11:17pm
Print Post Print Post  
Thanks for the replys. I plan to use the @filexists, but does that mean I have to "launch" that program to make it look for the file each time?

In other words, can sesame Constantly run the @fileexists all day long while watching for the .txt file to show up.

Thanks
Steve
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Can Sesame "monitor" a folder?
Reply #4 - Mar 12th, 2004 at 11:31pm
Print Post Print Post  
1.You could use @FileExists, and do a date/time comparison to see if it has changed.  You could use an INI file as a comparison point to ID when last changed.

2.  Could you create a bar code that could be scanned to trigger an input that would process the batch file?

3.  Following up on that thought----you could really get creative and create bar codes that could trigger any action, macro in Sesame..  Just input the scan into an element and trigger an event on ElementImmediateChange or ElementChange.  The actions to take would depend on the value of the barcode you just entered.  Example you could do a scan to print a receipt, update perpetual inventory balance, send a pickup form to shipping area, print out invoice, update a transaction log, send an email, make a merge document, make parking validation ticket, etc.  Only need one element on a form.  If you have multiple forms, then clone the element  on every form, in the same relative position, and put the scan response in Global Functions.

4.  Some scanner stations are programmable and you may be able to program a trigger from there also.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Can Sesame "monitor" a folder?
Reply #5 - Mar 12th, 2004 at 11:33pm
Print Post Print Post  
Sesame doesn't have an "on timer" event (yet). You might be able to integrate Sesame into your procedures a little differently. Sesame can be launched using the "-macro" flag. It also allows you to record "File->Exit" from the pulldown in your macro. That effectively turns Sesame into a "batch" processor. You could then lanuch Sesame in "batch mode" using the macro when the file is created. Sesame would open the relevant file and do as is needed done - then exit.

For example, you can create such a macro that reads your file in, processes it, and then exits - and use it to update four databases in a .bat file:

sesame -macro my_file_reading.mac One.db
sesame -macro my_file_reading.mac Two.db
sesame -macro my_file_reading.mac Three.db
sesame -macro my_file_reading.mac Four.db
  

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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Can Sesame "monitor" a folder?
Reply #6 - Mar 18th, 2004 at 8:09pm
Print Post Print Post  
Mark,

Your concept about using Sesame as a batch program is VERY interesting. I never would have thought of that.

I'll try it when I have time.

Thanks for the insight.

Steve in Texas
  
Back to top
IP Logged