Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 23rd, 2025, 6:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Script Object
PostPosted: July 11th, 2005, 4:04 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

If I want to set up a button and use a script object for it instead of a smaller script editor, how to I script the button's pressed trigger state to run the script that follows?

If I now want to add actions, like write to/read from registry, that I ordinarily use pre-set Opus actions for, how is this syntax done? I can place the correct registry path via "copy key name," but get lost in completing the "value" after the storage label's name, since that value is to be read by a "GetPosition()" script command. Is there a way to leave the value blank and have the pos.x or pos.y value for the item inserted?

Thanks for your help.

Kind Regards,
Stephen
05XE


Top
 Profile  
 
 Post subject:
PostPosted: July 17th, 2005, 4:03 am 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
Hi Stephen

you can include the variable/property pos.y or pos.x directly in the script command like this.

WriteRegistryValue( "HKEY_CURRENT_USER\\Software\\MyCompany\\ProgName", "KeyName", pos.y)

HTH
Chris

_________________
Opus Resources and Services


Top
 Profile Visit website  
 
 Post subject: OpusScript Get Color/Set Color actions
PostPosted: July 17th, 2005, 12:18 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks, Chris.

That last item "pos.y" was exactly what I didn't have and was looking for.
I'll give it a try.

Kind Regards,

Stephen


Top
 Profile  
 
 Post subject: OpusScript Get Color/Set Color actions
PostPosted: July 17th, 2005, 2:33 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

One item that I continue to need help with:

if I let the viewer clone muliple vector objects (graphic symbols) that they can drag and drop wherever they wish into a text box, how would I write a script that would GetPosition and SetPosition for each newly cloned object. Once a viewer creates their custom diagram via clone, drag and drop and navigates to another page, upon return the positions of clones is lost. So, a script that would get their position and save it to registry triggered by a "save" button clicked before navigating away, and a script triggered by a "re-set" button clicked upon return which would re-position cloned objects would be helpful. What I can't figure out is what label each newly created cloned object would have in a script (vector1ClonedObject1?) since I can't know when writing the script if or how many clones the viewer will create for each vector object.

Perhaps, this operation isn't possible. My goal in all of this is to simply allow a viewer to save the unique diagram that they create in a form that allows them to update, edit or change it, using the same executible publication in which it was created.

Any ideas would be welcome.

Thanks,
Kind Regards,
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: July 17th, 2005, 11:29 pm 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
"Perhaps, this operation isn't possible"

Wherever impossibility exists, there also resides the opportunity
to achieve the impossible.

In fact, this operation is far from impossible.
However, you face several scripting challenges on your way to your
goal.

The first is naming the clones, which isn't all that hard

1 Create a pub variable for each type of object like this Vector1Num
type = number
initial value = 0

2 Give the original object to be cloned an OnShow trigger with this code

------------------------------------------
eval("Vector1Clone"+Vector1Num+"= this")
Vector1Num++
------------------------------------------

this will give the original object the name Vector1Clone0
and each consecutive object the name Vector1Clone1, Vector1Clone2.......

you can then call script actions with the new "alias" that
was assigned each clone on show like this

Vector1Clone1.SetPosition(232,343)

Further challenges are storing the number and position of each clone of each
object type. Also, when the page is changed, the clones will be destroyed
so you will have to re-clone and reposition upon reset.

These problems are too complex and application specific for me to go into
here. Feel free to email me if you feel you need help completing your
project. I've been known to create complex code and solve impossible
scripting problems for very reasonable prices.


To: eomc40, Paul G, and anyone who downloaded "Logo.zip"

The Array.prototype functions included in that template were created
by Paul G. Unfortunately, eomc40 has given me credit by mistake.
While I would love to have created this very exceptional bit of script,
the work is not mine, and the credit belongs to Paul G.

HTH
Chris

_________________
Opus Resources and Services


Top
 Profile Visit website  
 
 Post subject: OpusScript Get Color/Set Color actions
PostPosted: July 18th, 2005, 12:47 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks

Because I couldn't figure out this complex operation, I had set up a work-a-round presenting the end-user with a finite number of pre-set symbols to drag and drop.

I'm afraid the further complexity and time needed for such a big task in light of project deadlines (now that I have an idea of what is involved) inclines me to stay with the work-a-round.

Maybe one day, when I'm better at this and have time, I'll tackle such an ambitious project.

Again, thanks for your ideas.

Kind Regards,
Stephen


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 38 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group