Log In
Sign Up and Get Started Blogging!
JoeUser is completely free to use! By Signing Up on JoeUser, you can create your own blog and participate on the blogs of others!
The High Redoubt
Script Questions/Wishes
Published on May 25, 2005 By
MountainDragon
In
DesktopX Development
I've been working on some DesktopX objects that involve quite a bit of scripting and I just ran into what could be a major problem for the current project (a drag and drop shortcut dockbar). Is it true that a shortcut type object doesn't expose the actual shortcut path to the script engine? The documentation for the object namespace doesn't mention this item.
This leaves me looking at having the script run the shortcut directly (not sure if that's possible either). Any help or suggestions would be greatly appreciated.
In addition, it would be real nice if the ActiveX controls would respond appropriately to tab keystroke when included in a parent object.
...
Popular Articles in this Category
3d rotation (dynamic - sorta) video
Popular Articles from MountainDragon
MSN Screensaver Beta
Comments
1
thomassen
on May 26, 2005
To execute a command:
Dim
WshShell
Set
WshShell
=
CreateObject(
"WScript.Shell"
)
WshShell.Run(strCommands)
Set
WshShell
=
Nothing
Here, the
strCommands
is a variable with the path to the file you want to run, or any other command valid for the Run method.
You might want to do some error catching there with On Error Resume Next (Look it up in the
documentation
if you are not familiar with it.)
2
MountainDragon
on May 26, 2005
Thomas, thanks for the suggestion. However, the .Exec method seems to be a better choice, since (at least in my system) the .Run method doesn't seem to be able to deal with paths that contain spaces. The .Exec funtion works as long as I dereference any shortcuts that are dropped. This is not bad since .CreateShortcut and then .TargetPath will give what I need.
3
thomassen
on May 27, 2005
Ah, for paths with spaces, use
WshShell.Run(chr(34) & strCommands & chr(34))
That should append a quote infront and behind your command.
4
MountainDragon
on May 28, 2005
Thanks again Thomas. I'm too spoiled by having worked in C and C++ for so long that I'm not used to dealing with so many unknowns about basic stuff
BTW, would you be interested in checking out the object I'm working on when I get it ready for testing?
5
thomassen
on May 29, 2005
Sure, I can have a look. But I might be rather busy until wednesday as I have a project deadline comming up.
I'm too spoiled by having worked in C and C++
I wish I could do C. I've looked at it, but I've realised it'd something you have to invest a little bit more time in than, VB, JS and PHP. Though, at the moment I'm reading a book about C#.
The only reason why I knew that you'd have to append a quote character is that I'm currently working on a Console like widget. Had to find out how to the the Run method to work.
6
MountainDragon
on May 29, 2005
Thomas, or anyone -
Is there anyway that you know of to get access to a program file's icon resource from within a DX script? I know I can do it for shortcut files, but I can't seem to find any reference to how to with the actual exe file. Since I don't have access to a shortcut object that gets dropped, I want to create my own image based shortcut (text based is easy) but I would like to be able to default the image to the current file icon.
Thanks
7
thomassen
on May 30, 2005
I've been thinking of making an object where I need to the same thing actually. I haven't tried, but I'll have a look when I've completed my project. I wonder if it can be loaded like windows does. Say if you want icon number 3 from the explorer.exe file you refer to it like this: "C:\windows\explorer.exe,3". Not sure if that'll work. Might have to use an ActiveX or COM control. I wonder if it's possible to use the Imagelist ocx control (from the Commom Control Library)... I've used that in VB applications, but I'm not sure if it can be used in DX scripting.
8
MountainDragon
on May 31, 2005
I found something that looks like it may work, but haven't had time yet to try it. Check it out:
Link
He has a lot of interesting script stuff.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
Richer content, access to many features that are disabled for guests like commenting on the forums.
Access to a great community, with a massive database of many, many areas of interest.
Access to contests & subscription offers like exclusive emails.
It's simple, and FREE!
Sign Up Now!
Meta
Views
» 4734
Comments
»
8
Category
»
DesktopX Development
Comment
Recent Article Comments
Modding Ara: History Untold
LightStar Design Windowblind...
DeskScapes 11: The Dream Mak...
Which A.I. Software Are You ...
ChatGPT 4o vs. o1 vs. o1 Pro...
What's the Last Book You Rea...
A day in the Life of Odditie...
Let's start a New Jammin Thr...
Let's see your political mem...
Safe and free software downl...
Sponsored Links