
NewBe
Active Members-
Posts
110 -
Joined
-
Last visited
Everything posted by NewBe
-
Perfect it works great.
-
Hello, I want a copy function but this do not work proper. I wants it to only copy the selected text #include <GUIConstants.au3> $Form1 = GUICreate("Form1", 460, 328) $Edit1 = GUICtrlCreateEdit("copy me", 0, 0, 457, 297) $Button1 = GUICtrlCreateButton("copy", 0, 296, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ClipPut(GUICtrlRead($Edit1)) MsgBox(0 , "test" , ClipGet()) EndSwitch WEnd
-
autoit tags are problems. Thanks for the select all worked perfect but I already had that copy function it selects all text.
-
Thanks ill give it a try tomorrow. I think all I need now is to find a way to copy and select all text with out using rich text edit thing I hope it is possible without it I am not sure if everyone has this but when I click on my edit control (text box) it gives me an option to copy , paste , select all can I some how use thoses with controlsend() or something.
-
If you could give me the source that would be a great help. Thanks
-
#include <File.au3> #include <Sound.au3> #include <GUIConstants.au3> Global $i , $Playlist $Form1 = GUICreate("Form1", 200, 200) $Play = GUICtrlCreateButton("Play", 0, 0, 75, 25, 0) $Stop = GUICtrlCreateButton("Stop", 0, 0, 75, 25, 0) $Prev = GUICtrlCreateButton("Prev", 0, 25, 75, 25, 0) $Next = GUICtrlCreateButton("Next", 0, 50, 75, 25, 0) $Load = GUICtrlCreateButton("Load", 0, 75, 75, 25, 0) GUISetState(@SW_SHOW) $i = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Play _MusicPlay() Case $Stop _SoundClose($Playlist) Case $Prev _Previous() Case $Next _Next() Case $Load _MusicList() EndSwitch WEnd Func _MusicPlay() If Not IsArray($Playlist) Then MsgBox(0, "", "please make a playlist first") EndIf For $Song = 1 To UBound($Playlist) -1 _SoundPlay($Playlist[$Song]) Next EndFunc Func _Previous() _SoundClose($Playlist) $i = $i - 1 _MusicPlay() EndFunc Func _Next() _SoundClose($Playlist) $i = $i + 1 _MusicPlay() EndFunc Func _MusicList() $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)") If @Error Then MsgBox(4096, "" , "No File chosen") Else FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF) _LoadPlaylist() EndIf EndFunc Func _LoadPlaylist() _FileReadToArray(@ScriptDir & "\Play List.txt", $Playlist) EndFunc for some reason I don't even have to call the function and it opens all the songs I tried it is hard reading autoit help file I have to keep translating it that is the whole purpose of me making my notepad maybe I should of worked on that first though lol but anyways this music part is almost done just need to fix that.
-
can't move on in my project since I don't understand a proper way to do things
-
but thats mean I would have to use _SoundPlay() instead of SoundPlay() and I never used AdLibEnable() can you maybe post an example?
-
I have a couple things I can't figure out, I have made a notepad and it turned out good so far except for a few small problems. I want to add music to my notepad this works but the _MusicPlay() function stops the script from doing stuff because of soundplay("myfile" , 1) instead of soundplay("myfile") and I don't know of a way to make it work because it does it in a For Next loop and even if I took that part out how will it know to play the next song? Func _MusicPlay() If Not IsArray($Playlist) Then MsgBox(0, "", "please make a playlist first") EndIf For $Song = 1 To Ubound($Playlist) -1 SoundPlay($Playlist[$Song] , 1) Next EndFunc Func _Previous() SoundPlay("") $i = $i - 1 _MusicPlay() EndFunc Func _Next() SoundPlay("") $i = $i + 1 _MusicPlay() EndFunc Func _MusicList() $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)") If @Error Then MsgBox(4096, "" , "No File chosen") Else FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF) _LoadPlaylist() EndIf EndFunc Func _LoadPlaylist() _FileReadToArray(@ScriptDir & "\Play List.txt", $Playlist) EndFuncoÝ÷ Úl©jË^~éܶ*'Â䲫}ç-nëg¢Û.èhÂÚ&jGrr~éܶ*'jwHv÷öÜÛh©ÙbëaÆ®¶sd6ÆWBb33cµFWBå6VÅFWB I don't want to GUICtrlCreateObj() if there is another way of copying highlighted text and I also need a function to highlight all text. If I can find ways to do all theses I will be set to move on to the fun functions. again I am sorry if you can't understand me my english is poor I can only type english from taking it a bit in school and using google Thanks
-
#include <File.au3> #include <GuiConstants.au3> Global $i , $Playlist GUICreate("Mini Notepad", 200, 50, Default , Default) $MusicMenu = GUICtrlCreateMenu("Music") $MusicPlay = GUICtrlCreateMenuitem("Play" , $MusicMenu) $MusicStop = GUICtrlCreateMenuitem("Stop" , $MusicMenu) $MusicSep = GUICtrlCreateMenuitem("" , $MusicMenu) $MusicPrev = GUICtrlCreateMenuitem("Prev" , $MusicMenu) $MusicNext = GUICtrlCreateMenuitem("Next" , $MusicMenu) $MusicClear = GUICtrlCreateMenuitem("Clear..." , $MusicMenu) $MusicList = GUICtrlCreateMenuitem("Play List..." , $MusicMenu) _LoadPlaylist() GUISetState(@SW_SHOW) $i = 1 While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $MusicPlay _MusicPlay() Case $MusicStop SoundPlay("") Case $MusicPrev _Previous() Case $MusicNext _Next() Case $MusicClear FileDelete(@ScriptDir & "\Play List.txt") $Playlist = "" Case $MusicList _MusicList() EndSwitch WEnd Func _MusicPlay() If Not IsArray($Playlist) Then MsgBox(0, "", "please make a playlist first") Return EndIf For $x = 1 To Ubound($Playlist) -1 SoundPlay($Playlist[$x]) Next EndFunc Func _Previous() SoundPlay("") $i = $i - 1 _MusicPlay() EndFunc Func _Next() SoundPlay("") $i = $i + 1 _MusicPlay() EndFunc Func _MusicList() $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)") If @Error Then MsgBox(4096, "" , "No File chosen") Else FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF) _LoadPlaylist() EndIf EndFunc Func _LoadPlaylist() _FileReadToArray("Play List.txt", $Playlist);creates new one;kills current playlist if there is one EndFuncoÝ÷ Øp¢¹,jY¨²Ú^÷µ»!Ú'ßÛeG¡£ ²±Êâ¦Ü(m~éܶ*'Áée¶¦ºÈÊek(§«¢+ÙͽչÁ±ä ÅÕ½Ðíµåͽչ¹ÝØÅÕ½Ðì°Ä¤(í¡¹Ñ¼)ͽչÁ±ä ÅÕ½Ðíµåͽչ¹ÝØÅÕ½Ðì doesn't work. Thanks
-
#include <Date.au3> MsgBox(0 , "Time" , _NowTime())
-
SoundPlay(FileReadLine($playlist[$x]),1) SoundPlay(FileReadLine($playlist^ ERROR thanks for putting up with me and my poor english
-
I am sorry , I am to tired to understand whats going on I been up for a day and a half now , I will try and figure out why it's still giving me errors tomorrow. Thanks a lot for helping me.
-
it is not working for some reason, i go to playlist add music hit play and it errors out. thanks
-
I am not scared to post my code it's that it is all not needed and I don't want to spoil the surprise, I know there are other media players must this one needs no GUI if I can get the playlist and prev and next and the play button all working I be great. I posted the top code to give you an example of what I have tried and making it look how I sort of need the code to be all at the same times. I have had no slept so I can not code it rights now. I hope you can understood. heres the code #include <GuiConstants.au3> Global $i $i = 1 GUICreate("Mini Notepad", 200, 50, Default , Default) $MusicMenu = GUICtrlCreateMenu("Music") $MusicPlay = GUICtrlCreateMenuitem("Play" , $MusicMenu) $MusicStop = GUICtrlCreateMenuitem("Stop" , $MusicMenu) $MusicSep = GUICtrlCreateMenuitem("" , $MusicMenu) $MusicPrev = GUICtrlCreateMenuitem("Prev" , $MusicMenu) $MusicNext = GUICtrlCreateMenuitem("Next" , $MusicMenu) $MusicClear = GUICtrlCreateMenuitem("Clear..." , $MusicMenu) $MusicList = GUICtrlCreateMenuitem("Play List..." , $MusicMenu) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $MusicPlay _MusicPlay() Case $MusicStop SoundPlay("") ; Case $MusicPrev ;_Previous() ; Case $MusicNext ; _Next() Case $MusicClear FileDelete(@ScriptDir & "\Play List.txt") Case $MusicList _MusicList() EndSwitch WEnd Func _MusicPlay() If Not FileExists(@ScriptDir & "\Play List.txt") Then MsgBox(0 , "" , "please create a playlist first") Else SoundPlay(FileReadLine(@ScriptDir & "\Play List.txt" , $i)) $i = $i + 1 $CountLines = _FileCountLines(@ScriptDir & "\Play List.txt") If $i = $CountLines + 1 Then $i = 0 EndIf EndFunc Func _Previous() SoundPlay("") $i = $i - 1 _MusicPlay() EndFunc Func _Next() SoundPlay("") $i = $i + 1 _MusicPlay() EndFunc Func _MusicList() $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)") If @Error Then MsgBox(4096, "" , "No File chosen") Else FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF) EndIf EndFunc will this helps more.
-
I am sorry I just ripped those functions out of my main script if you create a GUI with theses as buttons and set the proper function to the button you'll see what I mean. -play -prev -next -playlist I don't want the play button to skip to the next song when clicked, and prev and next doesn't seem to be working proper, I can't understand what I am doing wrong hard to read the autoit help file since it's not my language but people say I am a decent english typer which I don't think I am since I use google for most of the help which takes me awhile and even longer to correct it, or at least try.
-
It doesn't work proper.
-
*Bump* I am sorry to bump but I really need to move on in script
-
simple text to speech program (and "_speak" function
NewBe replied to emoyasha's topic in AutoIt Example Scripts
Shorter Global $voice = ObjCreate("Sapi.SpVoice") While 1 Speak(InputBox("" , "" , "" , "") ,1,100) If @error = 1 Then ExitLoop WEnd Func Speak($text, $Rate, $Volme) If IsObj($voice) Then $voice.Rate = $Rate $voice.Volume = $Volme $voice.Speak($text) EndIf EndFunc ;==>Speak I used that when I was bored didn't want to keep running the script. -
simple text to speech program (and "_speak" function
NewBe replied to emoyasha's topic in AutoIt Example Scripts
Global $voice = ObjCreate("Sapi.SpVoice") While 1 Speak(InputBox("" , "" , "" , "") , 1 , 100) WEnd Func Speak($text, $Rate, $Volme) If IsObj($voice) Then $voice.Rate = $Rate $voice.Volume = $Volme $voice.Speak($text) EndIf EndFunc ;==>Speak -
I am working on my biggest project ever and since there is a lot of code I get distracted and sometimes when I even attempt scripts this big I quit because I get frustrated and come up with other projects. I hope one of you guys can help me with this. Global $i $i = 1 Func _MusicPlay() If Not FileExists(@ScriptDir & "\Play List.txt") Then MsgBox(0 , "" , "please create a playlist first") Else SoundPlay(FileReadLine(@ScriptDir & "\Play List.txt" , $i)) $i = $i + 1 $CountLines = _FileCountLines(@ScriptDir & "\Play List.txt") If $i = $CountLines + 1 Then $i = 0 EndIf EndFunc Func _Previous() SoundPlay("") $i = $i - 1 _MusicPlay() EndFunc Func _Next() SoundPlay("") $i = $i + 1 _MusicPlay() EndFunc Func _MusicList() $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)") If @Error Then MsgBox(4096, "" , "No File chosen") Else FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF) EndIf EndFunc thats the most I can release of my code for now oh and _MusicPlay() shouldn't goto the next song , it is 7am here so I can't think of a better way
-
Yes! This works Perfect your Great!
-
I am having a problem I don't have any code to show since I erased and kept redoing it. I have a FileSaveDialog() and I want to be able to check weather or not people put a extension on when saving the file if not it will make it a simple text file. example if someone saves their file like this myfile they didn't put and extension on it so it will save it like this myfile.txt since *.txt is the default for my program or if they save it like this myfile.exe it will create a *.exe file instead of a *.txt and my problem is this when they don't add a extension it makes a file with *.txt extension but when they do add a extension this is how it looks like myfile.exe.txt I tried StringTrimRight($String , 4) but that wouldn't work which is odd. I hope you can understand this.
-
you are awesome it works, I was to tired to see that their were more colour options I guess because I only seen the one. Thanks a lot this will save me a lot of problems.
-
Interesting... If you add this function to a GUI with an Edit box called $Text and choose font and select a color it gives the wrong color I think it has to do with RGB and BGR or something like that, I rather just use _ChooseFont() instead of using _ChooseColor() as well so if you can help me get the correct color that would be great. Func _Font() $Font = _ChooseFont() If @Error Then ;;; Else GUICtrlSetFont($Text , $Font[3] , $Font[4] , $Font[1] , $Font[2]) GUICtrlSetColor($Text , $Font[5]) EndIf EndFunc When you run this function you'll see black as the default color and if you select a different color it gives a funny output. Sorry for not explaining so good I try