Sign in to follow this  
Followers 0
Anthony_Gischen

Newbie Needs Help

8 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Er, I think all he want's is

Run("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe")

Share this post


Link to post
Share on other sites

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 :)

[center]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.[/center]

Share this post


Link to post
Share on other sites

I'd would not know why he wants to run vba and within that autoit, if he just wants to start the reader.

I'd stick with one lang so things don't get messed up.

Share this post


Link to post
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!!! :)

Share this post


Link to post
Share on other sites

Thanks dabus for pointing mein the right direction

Share this post


Link to post
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
Sign in to follow this  
Followers 0