Executing several actions with one button

Hello

edited cause I figured how to do what I wanted

The only question remaining is....
can we program in desktopx an action if we click on a button with the right button of the mouse?
8,252 views 8 replies
Reply #1 Top

Have you had a look at https://www.stardock.com/products/desktopx/documentation/index.asp?

I personally believe (as having received no official training on this myself) the documentation there is sufficient, for the scripting side of things at least.

I think that considering what you're trying to do, scripting would give you a lot more control and flexibility. Just include support for Object_OnStateChange:

Code: vbscript
  1. </P>
  2. <P>Dim bVisible</P>
  3. <P>Sub Object_OnScriptEnter()
  4.   'Set our internal visible boolean variable to true...
  5.   bVisible = True
  6.   '...as it's toggled here
  7.   Call Toggle_Objects()
  8. End Sub</P>
  9. <P>Sub Object_OnStateChange(state)
  10.   Select Case state
  11.     'this case will be run based on the value at Relation-&gt;Start With from within the Object Properties dialog
  12.     Case "Command executed"
  13.       'put in your code here, for example you have two other objects labeled obj2 and obj3 (set to not visible from within their Object properties dialogs
  14.       Call Toggle_Objects()
  15.   End Select
  16. End Sub</P>
  17. <P>Sub Toggle_Objects()
  18.   'Reciprocate visible state
  19.   bVisible = Not bVisible
  20.   DesktopX.Object("obj2").Visible = bVisible
  21.   DesktopX.Object("obj3").Visible = bVisible
  22. End Sub</P>
  23. <P>
  24. Function Object_OnRButtonUp(x,y,bDragged)
  25.   If bDragged = False Then
  26.     MsgBox "Right Clicked!"
  27.   End If
  28.   'Tell the system this was handled, return True
  29.   Object_OnRButtonUp = True
  30. End Function</P>
  31. <P>

-Mike
[Stardock Support]

Reply #2 Top
Thank you for the model of script

I will use it, many thanks

I had checked the documentation and came to the same conclusion that you did.
There's a lack of documentation, and not even the advanced functions of desktopx

In fact, the problem is less about explanations than the lack of exemples.
There's a need to add exemples even for the easiest things.
If someone thinks he won't be able to use a program, I doubt he will buy it (I would not )
Reply #3 Top
DX is well documented I think.  What's more, because it can leverage standard languages not much more is needed.
All that is really needed is the reference names of built in functions (which exists).

Practice makes perfect and you always have the use of others objects (as examples) and you always have this forum for assistance.
Reply #4 Top
Thank you Milksama

I tested the script, it works perfectly.
Reply #5 Top
A great way to learn scripting is to download widgets and DX themes and poke around in them. Using DX documentation, the DX script helper widget, and examining some themes, I am now able to write my own effective script for auto-hiding DX docks and giving them a toggle button to turn the auto hide feature on and off. There are tons of example working scripts available in the DX libraries.   
Reply #6 Top
Ok for the exemples...

however I have specifics needs

By exemple, at the moment I search a way to create a calque that would display a text read from a .txt file
Is this possible?

explanation: I want to display several infos that are changing every days.
Reply #8 Top
I hear there are a lot of good tutorials around on the web.. or so im told...