XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 9:55 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: October 18th, 2013, 2:14 pm 
Offline

Joined: October 18th, 2013, 1:29 pm
Posts: 5
Hi there. Today I edited this mouse gesture win8 volume (which BTW is an amazing, very handy widget, thanks to qiancang) and xWidget just doesn't want to run the Open path function.

I need some help with this portion of the code: ( if needed, I can post the whole code)

Code:
   if (!isKeyDown(1) && isKeyDown(2))
             {
         if(mouseX>1300)
         {
           Open("C:\Program Files\eclipse\eclipse.exe"); // <<< here on this line, Open function doesnt open any path, only URLs
         }
             }


Some info about how should the widget work: the widget is made visible by pressing both left and right clicks, and then after releasing the left click, by simply moving the mouse cursor to the right edge of the screen, the widget should open a desired file or path. The widget disappears after releasing the right click.

Everytime I trigger the Open(string) function, it just doesn't open the path. It only works with URLs. This is so frustrating... Any ideas?

I am using Windows 8, xWidget ver: 1.8.4.716


Top
 Profile  
 
PostPosted: October 18th, 2013, 9:13 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
Try
run("C:\Program Files\eclipse\eclipse.exe");


Top
 Profile  
 
PostPosted: October 18th, 2013, 10:32 pm 
Offline

Joined: October 18th, 2013, 1:29 pm
Posts: 5
Well I did, still not working. I dont even know what alternatives I have, beucause Open2 does the same. Maybe linking a shortcutcore? Do you know how can I trigger the shortcutcore, by moving the mouse cursor to a given area of the screen ?


Top
 Profile  
 
PostPosted: October 18th, 2013, 11:00 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
Sorry if you have already done some of these but -
1 - Are you sure the line is being triggered ? add alert("triggered "); after the line to test if it is being triggered.
2 - Run the line run("C:\Program Files\eclipse\eclipse.exe"); from a button press to see if it works.


Top
 Profile  
 
PostPosted: October 18th, 2013, 11:07 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
First check if the if block is being called properly.

Code:
f (!isKeyDown(1) && isKeyDown(2))
             {
         if(mouseX>1300)
         {
            print("should open a program");
           //Open("C:\Program Files\eclipse\eclipse.exe"); // <<< here on this line, Open function doesnt open any path, only URLs
         }
             }

ALternatively you can try
Code:
WScript.Exec("C:\Program Files\eclipse\eclipse.exe");

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: October 18th, 2013, 11:57 pm 
Offline

Joined: October 18th, 2013, 1:29 pm
Posts: 5
Thanks for the idea of printing a message for checking the execution of the code in the specific block, but still the same. If you want to, I can upload the widget.
And for the WScript, I get an error. I searched for a quick fix but I am currently learning java, and I don't know much of scripting languages (JS, VB).


Attachments:
Screenshot (62).png
Screenshot (62).png [ 9.63 KiB | Viewed 7756 times ]
Top
 Profile  
 
PostPosted: October 19th, 2013, 12:51 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Did you copy the line verbatim? I referred to the WScript.Shell ActiveX object. Well, you mentioned that you are learning java, so these terms might be new to you. So here's the process:
Code:
var shell = new ActiveXObject("WScript.Shell");
shell.Exec("cmd.exe"); //put whatever path you want


These links will be helpful to learn more about scripting
http://msdn.microsoft.com/en-us/library/bb871583.aspx

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: October 19th, 2013, 1:42 am 
Offline

Joined: October 18th, 2013, 1:29 pm
Posts: 5
:o digigamer, thanks mate, you freaking ROCK !!! After a couple of tweaks, I found the solution:
shell.run("cmd /k start _path_", 0, false);
Now I can continue the work for my widget :) It will be a gesture based one, by simply dragging the cursor to a spot for performing different tasks, like show desktop (I like to hide my taskbar), or quickly getting to a link, etc. (possibilities are unlimited)
Cheers :D


Top
 Profile  
 
PostPosted: October 19th, 2013, 5:40 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
IMO, you won't require to prepend "cmd /k" in the path. (Unless, your OS is 64 bit)
And what's wrong with the Exec() didn't that work?

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: October 21st, 2013, 1:20 am 
Offline

Joined: October 18th, 2013, 1:29 pm
Posts: 5
Exec() didn't work for whatever reason (it was an error or something) and yes, I am on 64bit WIN8.


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 25 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:  

Powered by phpBB® Forum Software © phpBB Group