Jump to content

Recommended Posts

Posted (edited)

MyScript. NotepadArrayDisplay Library Function

;================Script sample===============
MsgBox(64, "", "Vert Array")
Dim $Array[4]
$Array[0]=1
$Array[1]=2
$Array[2]=3
$Array[3]=4
_NotepadArrayDisPlay($Array, "Array Display")
MsgBox(64, "", "Hori Array")
Dim $Array[4]=["A","B","C","D"]
_NotepadArrayDisPlay($Array, "Array Display")
;===============Notepad Array Display Library================
Global $Array, $Title
Func _NotepadArrayDisPlay($Array, $Title)
Dim $Output="", $Element
For $Element In $Array
$Output=$Output&$Array&$Element&@CRLF
Next
Run("Notepad.exe")
WinWaitActive("[Class:Notepad]")
WinSetTitle("[Class:Notepad]", "", $Title)
ControlSetText("[Class:Notepad]", "", "Edit1", $Output)
EndFunc ;NotepadArrayDisplay

Auto Sending : HighLight text (Select All)on the Edit (Notepad)

Local $TextMessage = "Hello World!"&@CRLF&"I Love AutoIt"&@CRLF&"Laymanball"
Local $TextEdit = "Notepad.exe"
Local $FileInfo = "readme.txt"
If FileExists($FileInfo)Then FileDelete($FileInfo)
If Not ProcessExists($TextEdit)Then Run($TextEdit)
WinWait("[Class:Notepad]")
ControlSetText("[Class:Notepad]", "", "Edit1", $TextMessage)
Sleep(1000)
WinMenuSelectItem("[Class:Notepad]", "", "&Edit", "Select &All")
Sleep(1000)
WinMenuSelectItem("[Class:Notepad]", "", "&File", "&Save")
WinWait("Save As")
ControlFocus("Save As", "", "[CLASS:Edit; INSTANCE:1]"&Send("readme.txt"))
Sleep(1000)
ControlFocus("Save As", "", "[CLASS:Edit; INSTANCE:2]"&Send("{Enter}"))
Sleep(1000)
WinClose("[Class:Notepad]")
Sleep(1000)
ShellExecute($FileInfo)
WinWait("[Class:Notepad]")
WinSetTitle("[Class:Notepad]", "", "readme.txt - ready")
Edited by Laymanball

My Sample Script

Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html

                     VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html

Posted

Where is a question? It's General Help and Support forum.

If you want to show your code write here. But please don't post this script there. Your code is useless.

Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font]

Posted

Also, if you mean for this to be an example script, you should explain what it does so that people can use it, rather than just look straight past the script, because most people wont read the script, but the explaination.

Posted

Where is a question? It's General Help and Support forum.<br> If you want to show your code write <a data-cke-saved-href="forum/9-example-scripts/" href="forum/9-example-scripts/" class="bbc_url" title="">here</a>. But please don't post this script there. Your code is useless.

Turns out the OP is barred from posting rubbish scripts in example forums.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted (edited)

Okay, are you having a problem with it?

Yes, I'm having a problem with it.

I can't writting array2d sending to the notepad.

Please help me.

Edited by Laymanball

My Sample Script

Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html

                     VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html

Posted (edited)

My script is rubbish scripts in the forums?!?. yes or no?

Please open wide. For beginners.

Edited by Laymanball

My Sample Script

Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html

                     VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html

Posted

#include <Array.au3>
;================Script sample===============
;MsgBox(64, "", "Vert Array")
;Dim $Array[4]
;$Array[0]=1
;$Array[1]=2
;$Array[2]=3
;$Array[3]=4
;_NotepadArrayDisPlay($Array, "Array Display")
MsgBox(64, "", "Hori Array")
Dim $Array[4][2] = [["A", 1],["B", 2],["C", 3],["D", 4]] ; you can make your 2D array like this
_NotepadArrayDisPlay($Array, "Array Display")
;===============Notepad Array Display Library================
Global $Array, $Title
Func _NotepadArrayDisPlay($Array, $Title)
Dim $Output = "", $Element
For $Element = 0 To 3 ;loop through it
  $Output &= $Array[$Element][0] & $Array[$Element][1] & @CRLF
Next
Run("Notepad.exe")
WinWaitActive("[Class:Notepad]")
WinSetTitle("[Class:Notepad]", "", $Title)
ControlSetText("[Class:Notepad]", "", "Edit1", $Output)
EndFunc   ;==>_NotepadArrayDisPlay

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

OK, but there is not much change there, all I changed is the declaration of one array instead of two, its commented, and the For...In...Next = For...To...Next

Good luck, and remember, the clearer you pose any question you might have, the better and more precise any answer will be.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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
  • Recently Browsing   0 members

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