Jump to content

Can't use Macro


Recommended Posts

Hi All, 

I am a total noob at Autoit. Recently I tried the following code :

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Button1 = GUICtrlCreateButton("Clear Temps", 8, 8, 137, 41)
$Button2 = GUICtrlCreateButton("Clear Prefetch", 8, 72, 137, 41)
$Button3 = GUICtrlCreateButton("Clear Un-necessary system files", 8, 136, 177, 41)
$Button4 = GUICtrlCreateButton("Clear Recycle Bin", 8, 200, 177, 41)
$Button5 = GUICtrlCreateButton("Disable Un-necessary Visualization", 8, 264, 185, 41)
$Button6 = GUICtrlCreateButton("Get System Info", 344, 8, 185, 33)
$Button7 = GUICtrlCreateButton("Check Compatibility", 160, 376, 265, 49)
GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button1
                FileRecycle(@DesktopCommonDir"\*.txt")          
    EndSelect
WEnd

FileRecycle(@DesktopCommonDir"*.txt")

or

FileRecycle("@DesktopCommonDir*.txt")

Neither of them works.

And also how can I make the following work?

MsgBox(0, "Testing", "Test : @SystemDir")

or

MsgBox(0, "Testing", "Test :" @SystemDir)

Edited by SirDarknight1200
Link to comment
Share on other sites

to combine strings, use the & character. your last example, i marked the & in green:

MsgBox(0, "Testing", "Test :" & @SystemDir)

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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...