Jump to content

Newbie Needs Help


Recommended Posts

Hi

I have downloaded autoit and think it is great. I want to run a simple script that opens an external program. I have basically manipulated the vbs scripts that come standard with the app. However when I run it it does not do anything. I have added the script below. Hope someone can point me in the right direction

Anthony

Option Explicit

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Declare Variables & Objects

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim oShell

Dim oAutoIt

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Initialise Variables & Objects

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set oShell = WScript.CreateObject("WScript.Shell")

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Start of Script

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

oAutoIt.Run "AcroRd32.exe", "C:\Program Files\Adobe\Acrobat 7.0\Reader"

WScript.Quit

Edited by Anthony_Gischen
Link to comment
Share on other sites

  • Moderators

Might want to download the Beta (will be needed) and take a look at Objects in there on how to use / impliment them.

Edit:

Beta: http://www.autoitscript.com/forum/index.php?showtopic=19717

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

1

Welcome to the forums

2

your script, as written, will not work with autoit

3

i wrote this just a few minutes ago

#include <GUIConstants.au3>

$folder = FileSelectFolder("Choose a folder.", "")

Run("explorer.exe " & $folder)
WinWaitActive("")
$window = WinGetTitle("")

Sleep(5000)

While 1

If WinActive($window) Then MsgBox(0,"Found", "The window is active" & @CRLF & $window, 2)

Sleep(15000)

WEnd

it opens a folder in explorer

8)

NEWHeader1.png

Link to comment
Share on other sites

  • Moderators

Er, I think all he want's is

Run("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe")
I don't think so, looks like he's trying to run it "from" his vb script via the AutoIt DLL, but you may be right that all he would need to do is execute that one line :)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

From the help file:

A variable is just a place to store data in memory so that it can be accessed quickly. Think of it as a mailbox in memory that you can put information in or take information out of. For example you might create a variable to store the number a user's response to a question, or the result to a math equation.

Each variable has a name (again, similar to a mailbox) and must start with the $ character and may only contain letters, numbers and the underscore _ character. Here are some example names:

Yeah, I know - the almighty dollar, yet again!!! :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...