Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
Yancka

Call script from script palette

Recommended Posts

The command can be called using:

DoMenuTextByName('Compose',0);

Is it possible to call a script from script palette in existing document? For example, in resources of my current file I have Script Palette named "My Scripts" with script in it named "The Magic Button". Is there a way to call "The Magic Button" script from scripts palette "My Scripts" from other script?

Share this post


Link to post

You can't call if from a script palette, but you can make it into a menu command, add it to the workspace and call it via a DoMenuTextByName('MyScript',0); command.

Use the Vectorscript Plugin Editor (Tools:Scripts) and copy/paste your script code into a new menu command.

Share this post


Link to post
You can't call if from a script palette

Pity.

but you can make it into a menu command, add it to the workspace and call it via a DoMenuTextByName('MyScript',0); command.

I was already doing that.

Thanks, Pat.

Share this post


Link to post

Btw, is it possible to create script palette and scripts on it using custom menu command?

Edited by Yancka

Share this post


Link to post

I don't think so. There are not VS commands to manage script palettes as far as I know.

If you are on a Mac, you might be able to do with with an Applescript, but you would have to script the GUI (graphical user interface: simulate moving and clicking the mouse).

A better use of Applescript would be to import a palette from a library file rather than trying to create it from scratch. But still not easy.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×