Shortcut object help without dozens of !!!'s

Tuesday, May 23, 2006 by weralacroix | Discussion: DesktopX

I want to control a shortcut object( folder shortcut) by script.I want to change the folder its showing at by scripting. How? object.what? any ideas?
Matchbook
Reply #1 Tuesday, May 23, 2006 10:01 PM
Ack! I do not presume to speak for anyone else on this site, but:
1. That title is TOO LONG! Eek!
and
2. That title is not very descriptive, is it?

Why not "DX help - Controlling a shortcut object", instead?

I can't answer your question anyhow, sorry mate! LOL..

Moderators/admins: This excessively long title is grossly breaking this site in Firefox - Can it be shortened by anyone?
http://www.causticfx.com/wc_broken.gif
See whatcha did to the place?
Ionolast
Reply #2 Tuesday, May 23, 2006 10:18 PM
Not only in Firefox.
Matchbook
Reply #3 Tuesday, May 23, 2006 10:29 PM
Yea, Opera surely didn't appreciate it, either. Same as IE6 and IE7, BETA2 heh
tjesterb
Reply #4 Tuesday, May 23, 2006 10:43 PM
Switched rendering engines (to IE from within FF) and it renders normally.
weralacroix
Reply #5 Wednesday, May 24, 2006 4:12 PM
hey guys sorry but i did not know it was messing with your explorers.but i do not understand how that happens and how did you change my title!
ZubaZ
Reply #6 Wednesday, May 24, 2006 4:40 PM
how did you change my title!


Admins have absolute power.[
RomanDA
Reply #7 Thursday, May 25, 2006 6:36 AM
Ok,
Tried to answer this the other day on IRC..

1. Make the Object you want to be the shortcut a LAYER not Shortcut object.
2. add this code to the object:

Dim Shortcut
Sub Object_OnScriptEnter
Shortcut = "d:\desktopx" '--Change this to whatever shortcut you want to use
End Sub

Function Object_OnLButtonUp(x,y,dragged)
If dragged = False Then
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
objShell.run (Chr(34)&shortcut&Chr(34))
Set Sh = Nothing
End If
End Function
What this does is really simple, you change the "Shortcut" value to whatever you want it to open.

- If you put in "C:\", it opens Explorer with that drive opened
- if you put in a exe it opens that exe file
- if you put in "C:\my documents" it will open that folder

Hope this helps
Cyberium
Reply #8 Tuesday, July 4, 2006 5:21 AM
Yay For the Run command *Dances* --- Another way to display the actual name of the folder being displayed (i.e. "My Documents") in an object would be to use FileSystemObject ... See the tutorials in the DX Scripting Guide and follow the links to Microsoft MSDN site (this is an extremely useful site, lots of potential fun can be had)

Please login to comment and/or vote for this skin.

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 and downloading skins.
  • 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!



web-wc01