Scripting - A way to create objects by script ?

Hi everybody again...

Is there a way to make objects created by a script ?

I'm actually working on a dock widget, and I've scripted a right click menu with the item 'Create new shorcut'.
The only way I've found to achieve this within my script is to have a blank shortcut, which is hidden, containing its own script (for it to zoom in and out, like in ObjectDock, and a menu to set properties). Then I create a new one by cloning it with DesktopX.Object(Name).Clone NewName,x,y

It works fine, but I would go further. I'd like to implement those shortcuts as a class in my main script to simplify the code, but in the class Initialize Method, I have to create the DesktopX object.

I found nothing telling it's possible. Is anybody knows ?

Thx
7,141 views 3 replies
Reply #1 Top

Creating Objects from scratch is not possible afaik. You will just (as you mentioned) need to have a hidden tempate object from which you create your clones. From what I've seen, this is the way DesktopX scripters do things.

Using the Ex callbacks in conjunction with the DesktopX.Object("") accessor, you technically should not need to include scripts in each of the dock objects you create, though you could still do it this way of course.

-Mike
[Stardock Support]

Reply #2 Top
Ok, So I did well...

I will try to use vbScript classes anyway (I will clone a template object in the creator method), because I think it's an elegant way to set / get complex properties, reflecting on the onscreen object with an elegant code. I'll submit you an exemple if reach my objective.

Is there anyone here who already did that ?

Stf