Shortcut object help without dozens of !!!'s

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?
2,817 views 8 replies
Reply #1 Top
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?
Reply #2 Top
Not only in Firefox.
Reply #3 Top
Yea, Opera surely didn't appreciate it, either. Same as IE6 and IE7, BETA2 heh
Reply #4 Top
Switched rendering engines (to IE from within FF) and it renders normally.
Reply #5 Top
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!
Reply #6 Top
how did you change my title!


Admins have absolute power.[
Reply #7 Top
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
Reply #8 Top
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)