Musisback Posted July 27, 2010 Share Posted July 27, 2010 How to run script automaticly at certain instant? For example at the starting or closing of the programme, or when we print. That would be very handy, Thanks, Quote Link to comment
maarten. Posted August 8, 2010 Share Posted August 8, 2010 You can make a menucommando that will run your script and at the ending call the rpint dialog: PROCEDURE BlaBla; BEGIN {your code} DoMenuTextByName('Print',0); END; RUN(BlaBla); I gues you can do the same when you open a file (not tested): PROCEDURE BlaBla; BEGIN DoMenuTextByName('Open',0); {your code} END; RUN(BlaBla); As far as i know it's not possible to automatically run a script at the begin or end of the program. Quote Link to comment
WhoCanDo Posted August 18, 2010 Share Posted August 18, 2010 I've been asking for the same for a while now. Just like Excel will run Private Sub Workbook_Open() I would like to do a bit of setup as the stationary sheet is opened. Quote Link to comment
maarten. Posted August 18, 2010 Share Posted August 18, 2010 There's some helpfull information about this in "What VectorScript Can't Do" in the "VS Language Guide". Quote Link to comment
Musisback Posted August 23, 2010 Author Share Posted August 23, 2010 You can make a menucommando that will run your script and at the ending call the rpint dialog: PROCEDURE BlaBla; BEGIN {your code} DoMenuTextByName('Print',0); END; RUN(BlaBla); I gues you can do the same when you open a file (not tested): PROCEDURE BlaBla; BEGIN DoMenuTextByName('Open',0); {your code} END; RUN(BlaBla); I tried it to update automaticly a "date PIO" so that I always know at what time my file is printed. Well, it does not work. For some raison, it prints the file before updating the drawing. I tried to add wait(1) and redrawall to my script to let the time to update, is doesn't change anything.... Quote Link to comment
maarten. Posted August 25, 2010 Share Posted August 25, 2010 There's an example on the Belgium forum of a script that does just what you need. Search for the topic "bestandsnaam op plannen" and in post 100 you'll find the finished script. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.