Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - How to write a script/macro

Reply
 
Old 11-17-2008   #1 (permalink)
Legaldeejay


 
 

How to write a script/macro

Hi all:

I am using a program called Macro Scheduler to run a macro. But I would
rather run the macro using a script without the program so I don't have to
pay $$ for the program.

The Macro I have simply opens a program, I then Alt-T, press u, then Enter,
and then Alt F4 to close the program. Can anybody tell me how to write the
script to do these commands?

These are the commands in Macro Scheduler when using the Editor:

// C:\Documents and Settings\abokar\My Documents\Macro Scheduler\Copernic
2.scp
// Recorded on Sunday, November 16, 2008, at 09:28 PM

// Run program and wait for it to be active
Change Directory>C:\Program Files\Copernic Desktop Search 2
Run Program>C:\Program Files\Copernic Desktop Search 2\DesktopSearch.exe
WaitWindowOpen>Copernic Desktop Search 2 - Home Edition

// Ensure it always opens with the same dimensions
MoveWindow>Copernic Desktop Search 2 - Home Edition,-4,-4
ResizeWindow>Copernic Desktop Search 2 - Home Edition,1032,742

// Focus the app
SetFocus>Copernic Desktop Search 2 - Home Edition

//Recorded Events
Let>WW_TIMEOUT=5
CapsOff
MouseMove>505,422
Wait>2.14
Press ALT
Wait>0.59
Send>t
Wait>0.14
Release ALT
Wait>1.25
Send>u
Wait>1.36
Press Enter
Wait>3.62
Press ALT
Wait>0.64
Press F4
Wait>0.23
Release ALT



My System SpecsSystem Spec
Old 11-17-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: How to write a script/macro


"Legaldeejay" <Legalaid@xxxxxx> wrote in message
news:49215895$0$4919$607ed4bc@xxxxxx
Quote:

> Hi all:
>
> I am using a program called Macro Scheduler to run a macro. But I would
> rather run the macro using a script without the program so I don't have to
> pay $$ for the program.
>
> The Macro I have simply opens a program, I then Alt-T, press u, then
> Enter, and then Alt F4 to close the program. Can anybody tell me how to
> write the script to do these commands?
>
> These are the commands in Macro Scheduler when using the Editor:
>
> // C:\Documents and Settings\abokar\My Documents\Macro Scheduler\Copernic
> 2.scp
> // Recorded on Sunday, November 16, 2008, at 09:28 PM
>
> // Run program and wait for it to be active
> Change Directory>C:\Program Files\Copernic Desktop Search 2
> Run Program>C:\Program Files\Copernic Desktop Search 2\DesktopSearch.exe
> WaitWindowOpen>Copernic Desktop Search 2 - Home Edition
>
> // Ensure it always opens with the same dimensions
> MoveWindow>Copernic Desktop Search 2 - Home Edition,-4,-4
> ResizeWindow>Copernic Desktop Search 2 - Home Edition,1032,742
>
> // Focus the app
> SetFocus>Copernic Desktop Search 2 - Home Edition
>
> //Recorded Events
> Let>WW_TIMEOUT=5
> CapsOff
> MouseMove>505,422
> Wait>2.14
> Press ALT
> Wait>0.59
> Send>t
> Wait>0.14
> Release ALT
> Wait>1.25
> Send>u
> Wait>1.36
> Press Enter
> Wait>3.62
> Press ALT
> Wait>0.64
> Press F4
> Wait>0.23
> Release ALT
You could use AutoIt (http://www.autoitscript.com/autoit3/downloads.shtml).
AFAIK, it's free. However, you should note that keyboard macros are
inherently unstable. The slightest unexpected event can and will upset them,
e.g.
- A virus scanner update pop-up
- A task taking longer than expected
- An unexpected response from the program you're controlling.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Using script/FSO to write files with authentication VB Script
Write a macro for sleep Vista General
How to write a script to process it as a task? PowerShell
VBS Script to Run Macro in Access 2003 VB Script
Group Policy - I need to write a script to run on shutdown Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46