Sign in to follow this  
Followers 0
leondror

I have 3 questions... Pease help me

4 posts in this topic

I is beginner autoit script programmer. Please help me.

I have 3 questions...

1) Question.

Exist problem with this.

#include <ChangeResolution.au3>

On compiling process (SciTE4Autoit3) i get next message:

#include <ChangeResolution.au3>

Error: Error opening the file

I have XP PRO SP2 and AutoIt v3.2.12.1

My code:

#NoTrayIcon

#include <GUIConstants.au3>

#include <ChangeResolution.au3>

;;

;~ Change Screen Parameters

If $CmdLine[1]="ChangeScreenParam" then

$Rezolution=_ChangeScreenRes($CmdLine[2] ,$CmdLine[3] ,$CmdLine[4] ,$CmdLine[5])

FileDelete(@TempDir & "\ScreenParam.at_")

$filepar = FileOpen(@TempDir & "\ScreenParam.at_", 1)

FileWriteLine($filepar, $CmdLine[2])

FileWriteLine($filepar, $CmdLine[3])

FileWriteLine($filepar, $CmdLine[4])

FileWriteLine($filepar, $CmdLine[5])

FileClose($filepar)

EndIf

Exit(@error)

2) Question.

I dont get result for @HomeShare. (I have XP PRO SP2) AutoIt v3.2.12.1 ;~

Get HomeInfo If $CmdLine[1]= GetHomeInfo then FileDelete(@TempDir &

HomeInfo.txt ) $fileHInfo = FileOpen(@TempDir & HomeInfo.txt , 1)

FileWriteLine(@TempDir & HomeInfo.txt , @HomeShare)

FileWriteLine(@TempDir & HomeInfo.txt , @HomeDrive)

FileWriteLine(@TempDir & HomeInfo.txt , @HomePath) FileClose($fileHInfo)

EndIf

3) Question.

;~ This not normal! If number of If is = to number of EndIf - as get ERROR!I have XP PRO SP2,

AutoIt v3.2.12.1;~

;~ InputBox

If $CmdLine[1]="InputBox" then

If Not IsDeclared("sInputBoxAnswer") Then Dim $sInputBoxAnswer

$sInputBoxAnswer = InputBox($CmdLine[2],$CmdLine[3],$CmdLine[4],$CmdLine[5],$CmdLine

[6],$CmdLine[7],$CmdLine[8],$CmdLine[9])

Select

Case @Error = 0 ;OK Button

FileDelete(@TempDir & "\InputBox.at_")

FileWrite(@TempDir & "\InputBox.at_", $sInputBoxAnswer)

Case @Error = 1 ;Cancel Button

Case @Error = 3 ;The InputBox failed to open

EndSelect

endif

endif

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@Q 1

Where is ChangeResolution.au3 located?

I think the only places it can be are:

AutoItDir\Include\

AutoItDir\Beta\Include\

Edited by LongBowNZ

Share this post


Link to post
Share on other sites

As for number 2, what output are you getting and what are you expecting? You may be misunderstanding the macro.

On number 3, you can't have code on the end of an If Then statement but use a block. You must move the Dim statement down to the line below.

Share this post


Link to post
Share on other sites

Thanks all. Now I know more. After change all works! But I do not understand when and as it is possible to use macros: @HomeShare and @LogonDNSDomain to get result. There can be for this purpose my computer should be a network server? :)

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