help with shuffle text

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
djowdias97
Posts: 9
Joined: 22 Apr 2021, 16:27

help with shuffle text

Post by djowdias97 » 27 Sep 2021, 14:52

hi i need help, is it possible to make a script that reads the notepad
and shuffle it, for example, my notepad is like this

car
bus
house
bike

then after it reads and saves in a new text file it would be like this

bike
bus
car
house

is it possible to do that? Can someone help me?

User avatar
mikeyww
Posts: 26888
Joined: 09 Sep 2014, 18:38

Re: help with shuffle text

Post by mikeyww » 27 Sep 2021, 15:03

Code: Select all

new := A_ScriptDir "\new.txt"
ControlGetText, text, Edit1, ahk_exe notepad.exe
; Sort, text, Random
Sort, text
FileRecycle, %new%
FileAppend, %text%, %new%
Run, "%new%"

djowdias97
Posts: 9
Joined: 22 Apr 2021, 16:27

Re: help with shuffle text

Post by djowdias97 » 27 Sep 2021, 15:36

mikeyww wrote:
27 Sep 2021, 15:03

Code: Select all

new := A_ScriptDir "\new.txt"
ControlGetText, text, Edit1, ahk_exe notepad.exe
; Sort, text, Random
Sort, text
FileRecycle, %new%
FileAppend, %text%, %new%
Run, "%new%"
thank you bro , nice work!!

Post Reply

Return to “Ask for Help (v1)”