I'll confess that I'm a bit of a novice when it comes to automation in our tools (fortunately Mentor Graphics has experts in this area, I'm just not one of them). Still, I occasionally dabble in the creation of Visual Basic scripts that help me troubleshoot problems or configure an application the way I need it for testing purposes. In this Tip of the Week, I'll show you something I learned that simplified development of my scripts.

 

I was unaware of this feature until one of the aforementioned experts told me that I could use Windows Explorer to drag and drop my .vbs file onto the application window. Doing that will execute the script without the need to put any of the files in a certain location, modify the scripts.ini file, or exit and re-start the application. For example:

 

dragdrop.jpg

The application looks at the type of file you've selected and will put a '+' sign next to your cursor if the file type is compatible with the place you want to drop the file. If it's not compatible, you'll see a circle with a circle with a '/' through it. Using this method allows you to quickly test and debug the script before you put it into your production environment.

 

Something I learned as I was writing this blog is pretty useful as well, so I thought I'd share that as well. It seems the Message Window is compatible with a number of file formats. So far I've used this trick to view .jpg, .png, .txt and .pdf files in the applications message area!

 

Thanks for reading. I hope this tip was useful.

 

Ken Foster

Mentor Graphics Customer Support