Hey all,
I'm sure most of you think i have given up on DX. Its been months since I posted
anything on DX scripting, or creation. Just been working my butt of out-of-town
for most of the past 4 months.
Actually I'm sitting in a hotel room right now. Anyway, I was looking at something the other
day and wondered how many little SIMPLE tricks are hidden in DX. I was talking
to miksama the other day and he pointed sent me some cool things.
I wanted to share some things that not everyone might know about, or even use.
If you know one of these and have been using it forever, goodie, show us
something you think we dont know about. I want this it be an ongoing article
with lots of user input.
These will require that you know at lease some basics of scripting in DX. If you
don't you might want to do a simple Google search for DesktopX Tutorials, I hear
SOMEONE spent a great deal of time on some.
Lets get this started with a few 1 liners.
PING:
You want to ping a web site and get the resulting time to site.
|
x = system.Ping("www.wincustomize.com")
object.text = x & " ms"
|
WALLPAPER:
Want to change your wallpaper?
This is the quick way to do it.
Option:
0 = use
default wallpaper
1 = Center wallpaper
2 = Tile wallpaper
3 = Stretch wallpaper
|
'Examples:
System.SetWallpaper "C:\temp\wall1.bmp", 1
'Sets the wallpaper to the bmp above and the 1 makes it centered.
System.SetWallpaper Object.Directory & "wall1.jpg", 2
'Sets the wallpaper to wall1 in the directory where the dx object was created, and the 2 tiles it.
System.SetWallpaper "", 0
'This will restore the original wallpaper.
|
CLIPBOARD:
Say you want to dump something from DX to the windows clipboard?
Its 1 line of
code easy.
I believe this works only with TEXT, not images, but i could be
wrong.
|
System.Clipboard = Object.text
|
VOLUME/MUTE:
Ok, want a fast way to set your volume to 10? or 90? or mute it completely?
|
system.Volume = 10
system.Volume = 90
'or mute it
system.mute
|
READ A FILE
Want to dump the contents of a file to a text string?
Only param=1 is currently
supported.
|
txtLog = System.SimpleRead("C:\temp\file2read.txt", 1)
|
WRITE TO A FILE
Ok, this is simple, dump the contents of a string into a file.
Only param=1 is
currently supported.
|
txtstring = "This is the text string, could have anything in here" & vbnewline & "even on a second line"
System.SimpleWrite "C:\temp\output.txt", txtstring, 1
|
These are just a few simple
SYSTEM tricks. What do you have up your DX sleeve?