
PERTU
Active Members-
Posts
32 -
Joined
-
Last visited
Everything posted by PERTU
-
Thanks to both of you. sahsanu: I tried to copy paste your code and didn't work. I tried to understand it but it is difficult. I'll try again once I'm more awake Malkey: It worked when I removed "@ScriptDir & "\"; ". Right now I understand the logic behind this code. I'll just have to go check the parameters to all functions in details to learn about this code.
-
Hi, I have a folder with videos named like: DpRiley01.wmv, DpRiley02.wmv, Dallara01.wmv, Dallara02.wmv etc... I want my script to find the number of the next video I save. For example my next DpRiley video would be number 03. The way I'm trying to do it is to use _FileListToArray to put all the filename in an array, remove the last sixth character, count how many times DpRiley is in the Array and add +1 to this number. I don't know how to count how many times DpRiley is in the array. Here is my Code so far: $video = "DpRiley" $FileList=_FileListToArray("C:\Users\Olivier\Videos") If @Error=1 Then MsgBox (0,"","No Folders Found.") Exit EndIf If @Error=4 Then MsgBox (0,"","No Files Found.") Exit EndIf _ArrayTrim($FileList, 6, 1) $FileCurentVersion = "I don't know how to find it" $FileNewVersion = $FileCurentVersion + 1 MsgBox (0,"", $FileNewVersion) Thanks for helping me.
-
error 50 in _Inetsmtpmail function
PERTU replied to qaravi's topic in AutoIt General Help and Support
Is there a way to work around this? Thanks, Olivier. -
Some questions about _ArrayDisplay.
PERTU replied to PERTU's topic in AutoIt General Help and Support
I finally got to update my script and I was able to test it with an episode of 162 scenes. It now seems to work without bug, it's faster than ever, and the new functionality to select misnamed files works like a charm. I'm really happy right now. Thanks to everyone that helped me with this script. Olivier. -
Some questions about _ArrayDisplay.
PERTU replied to PERTU's topic in AutoIt General Help and Support
Yes, you are right about this. However, I will be the only one using this script, so I'll know to use a number and not a string. I did it this way because i'm new to this and didn't know better. I look at your suggestions and it make sense, so I'll probably update this part of my script. It seems to be a good Idea. I don't have time right now to update my script. I'm overloaded at work, so I'll probably have to wait until monday or tuesday to continue working on my script. I tried using the current version of my script and I found another bug. It's not returning the correct version of the scene . So thank you, and I'll keep you updated once I have time to try your suggestions. Olivier. -
Some questions about _ArrayDisplay.
PERTU replied to PERTU's topic in AutoIt General Help and Support
Hey weaponx, If I don't find a way to avoid using the clipboard, I'll give your method a try. Thanks. randallc I'm noob and I'm not sure what a UDF is. So I'll try to look up what that means, and I'll see. Thanks. Olivier -
Some questions about _ArrayDisplay.
PERTU replied to PERTU's topic in AutoIt General Help and Support
Yes, I want to move the files to E:\Renderset\SUBFOLDER. I already have a variable to fill the name of the subfolder. You can forget all about MoveRenderset.tmp. As you can see those line are commented in the script. It is just a way I tried to make it work. I will delete those line, they are obsolete. Yes this is what I'm trying to do. For example I wan to move E:\usadata000\go_be\scene-011\frames\be011_007-0001.tga to E:\Renderset\be\be011_007\be011_007-0001.tga. Most of the times, my script will find the file I want to move and move them. But some times, some people make mistakes when they name the file. For example they could name the file be011_0070001.tga instead of be011_007-0001.tga. In those case I want to be able to inspect the file and make the decision to move certain of the file. I hope I'm explaining myself clearly. Thanks, Olivier. -
Some questions about _ArrayDisplay.
PERTU replied to PERTU's topic in AutoIt General Help and Support
Hi, What my script does is move certain files to a new directory based on information I input into some input box. The script find those files automatically based on the input I give. But if for some reason the script is not able to find the file I want. The script does a _FileListToArray to allow me to manually select the files I want to be moved. I'd like to be able to select some files from the _ArrayDisplay window, click on TextSelected, and when I click on the close button, I want the script to move those files. I don't know how to move files based on filenames that are stored on the clipboard. So I tought It would be best to store those filenames in an array instead, and work from there. There is the script I got so far. Some part are in french. Look for this line of comment in the script: ";I want to move the file that are listed in $selframes to $dirrenderset & "\*.tga"", this is where I am stuck. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.4.9 Author: PERTU Credits: I got the help of those people from AutoIt forum. BugFix, SmOke_N, Paulie, evilertoaster, PsaltyDS, ssubirias3 Script Function: MoveRenderset #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #Include <File.au3> #Include <Array.au3> #include <string.au3> $defepisode = IniRead(@ScriptDir & "\MoveRenderset.ini", "Parameters", "LastUsedEpisode", "aa") ;Lecture du denier episode dans le .ini $dir = "E:\usadata000" $defscene = "1" While 1 $episode = InputBox("MoveRenderset", "Quel épisode?", $defepisode , "") If @Error=1 Then Exit EndIf $episode = StringRight( $episode , 2) IniWrite(@ScriptDir & "\MoveRenderset.ini", "Parameters", "LastUsedEpisode", $episode) $direpisode = $dir & "\" & "go_" & $episode _FileListToArray($direpisode) If @Error=1 Then _FileWriteLog(@ScriptDir & "\MoveRenderset.log"," L'épisode " & $episode & " est introuvable" & @CR & @CR & @CR) MsgBox (16,"MoveRenderset","L'épisode " & $episode & " est introuvable") Exit EndIf $scene = InputBox("MoveRenderset", "Quel scène?", $defscene , "") If @Error=1 Then Exit EndIf ; Vérifie si la scène contient une lettre et trouve le numéro de scène. $scene = "00" & $scene $digit = StringIsDigit($scene) If $digit = 1 Then $scene = StringRight($scene, 3) Else $scene = StringRight($scene, 4) EndIf $dirscene = $direpisode & "\scene-" & $scene $dirframes = $dirscene & "\frames" $dirstage = $dirscene & "\stage" _FileListToArray($dirscene) If @Error=1 Then _FileWriteLog(@ScriptDir & "\MoveRenderset.log"," La scene " & $scene & " est introuvable" & @CR & @CR & @CR) MsgBox (16,"MoveRenderset","La scene " & $scene & " est introuvable") Exit EndIf $ArFrames = _FileListToArray($dirframes) $frames = _ArrayToString( $ArFrames,@TAB, 0, 0 ) If @Error=1 Then MsgBox (16,"MoveRenderset","Le dossier ""frames"" est vide") Exit EndIf ; Déterminer la version de la scène $ArVersion = _FileListToArray($dirstage) For $i = 0 To UBound($ArVersion)-1 $number = _StringBetween($ArVersion[$i], 'v', '.') If IsArray($number) Then $ArVersion[$i] = Number($number[0]) EndIf Next $version = StringRight('00' & _ArrayMax($ArVersion, 1), 3 ) $dirrenderset = "E:\Renderset\" & $episode & "\" & $episode & $scene & "_" & $version DirCreate($dirrenderset) $filename = $episode & $scene & "_" & $version & "-" & "*.tga" FileMove($dirframes & "\" & $filename, $dirrenderset & "\*.tga") $ArFrames = _FileListToArray($dirrenderset) If @Error=4 Then _FileWriteLog(@ScriptDir & "\MoveRenderset.log"," Les frames " & $filename & " sont introuvables" & @CR & @CR & @CR) $yesno = MsgBox(4,"MoveRenderset","Les frames " & $filename & " sont introuvables." & @CR & "Voulez-vous voir la liste des TGA dans le dossier?") If $yesno = 7 Then Exit Else $tgadir = _FileListToArray($dirframes, "*.tga") _ArrayDisplay($tgadir, "MoveRenderset - Liste TGA de " & $episode & $scene) EndIf $selframes = ClipGet() MsgBox(0, "Clipboard contains:", $selframes) ;I want to move the file that are listed in $selframes to $dirrenderset & "\*.tga" ;If FileExists(@ScriptDir & "\MoveRenderset.tmp") Then ; FileDelete(@ScriptDir & "\MoveRenderset.tmp") ; EndIf ;_FileCreate(@ScriptDir & "\MoveRenderset.tmp") ; $yesno = MsgBox(4,"MoveRenderset","Voulez-vous déplacer tout les TGA de la liste précédente?") ; If $yesno = 7 Then ; Exit ;Else ; FileMove($dirframes & "\*.tga", $dirrenderset & "\*.tga") ; $ArFrames = _FileListToArray($dirrenderset) ;EndIf EndIf $frames = _ArrayToString( $ArFrames,@TAB, 0, 0 ) _FileWriteLog(@ScriptDir & "\MoveRenderset.log","//-----------------------" & @CR & @CR & "Épisode: " & $episode & @CR & "Scène: " & $scene & @CR & "Version: " & $version & @CR & "Nb de frames: " & $frames & @CR & @CR & "Déplacement terminé -----------------------\\" & @CR & @CR & @CR) MsgBox(0, "MoveRenderset", "Épisode: " & $episode & @CR & "Scène: " & $scene & @CR & "Version: " & $version & @CR & "Nb de frames: " & $frames & @CR & @CR & "Déplacement terminé") $defepisode = $episode $defscene = $scene + 1 WEnd Olivier. -
Some questions about _ArrayDisplay.
PERTU replied to PERTU's topic in AutoIt General Help and Support
I tried TextSelected and it put it to the clipBoard like you said. But I need the selection to be in an array. Is there an easy way of doing this? I tried searching for ClipToArray or StringToArray but I couldnt find those functions. Thanks, Olivier. -
Some questions about _ArrayDisplay.
PERTU replied to PERTU's topic in AutoIt General Help and Support
Hey ssubirias3, I'll definately try TextSelected and the clipboard. It might be just what I needed for my script. For your other suggestions, about modifying array.au3 and a custom GUI, I'll pass. This is too complicated for me right now. To be honest, I don't really need these things in my script. It would have been sweet to implement it, but it is mostly eye candy. If anyone have a simple solution for question 2 to 4, i'd like to hear about it, if not, no big deal, but it would be interesting to know. Thanks, Olivier. -
Hi, I have some questions about _ArrayDisplay, I searched the help file and forums but couldn't find my answers. What does the "TextSelected" button do, and how to use it?How can I have the "Close" button preselected when the _ArrayDisplay window open?Is it possible to NOT display row 0?Is it possible to add some text between the titlebar and the table?How can I resize the window?Thank you,Olivier.
-
Thank you SmOke_N. After removing an extra EndIf It works perfectly.
-
I had 2 other bug with my script beside the current version bug. I have fixed both of them, but the current version is still not working. So I ask again If someone can help me. Thank you, Olivier.
-
I get a different error now: CODELine 119 (File ... .au3"): $ArVersion[$i] = Number($number[0]) $ArVersion[$i] = Number($number^ERROR Error: Subscript used with non-Array variable. Here is my script, Line 119 is the third from the bottom. #Include <File.au3> #Include <Array.au3> #include <string.au3> $defepisode = IniRead(@ScriptDir & "\MoveRenderset.ini", "Parameters", "LastUsedEpisode", "aa") ;Lecture du denier episode dans le .ini $dir = "E:\usadata000" $defscene = "1" While 1 $episode = InputBox("MoveRenderset", "Quel épisode?", $defepisode , "") If @Error=1 Then Exit EndIf $episode = StringRight( $episode , 2) IniWrite(@ScriptDir & "\MoveRenderset.ini", "Parameters", "LastUsedEpisode", $episode) $direpisode = $dir & "\" & "go_" & $episode _FileListToArray($direpisode) If @Error=1 Then _FileWriteLog(@ScriptDir & "\MoveRenderset.log"," L'épisode " & $episode & " est introuvable" & @CR & @CR & @CR) MsgBox (16,"MoveRenderset","L'épisode " & $episode & " est introuvable") Exit EndIf $scene = InputBox("MoveRenderset", "Quel scène?", $defscene , "") If @Error=1 Then Exit EndIf ; Vérifie si la scène contient une lettre et trouve le numéro de scène. $scene = "00" & $scene $digit = StringIsDigit($scene) If $digit = 1 Then $scene = StringRight($scene, 3) Else $scene = StringRight($scene, 4) EndIf $dirscene = $direpisode & "\scene-" & $scene $dirframes = $dirscene & "\frames" $dirstage = $dirscene & "\stage" _FileListToArray($dirscene) If @Error=1 Then _FileWriteLog(@ScriptDir & "\MoveRenderset.log"," La scene " & $scene & " est introuvable" & @CR & @CR & @CR) MsgBox (16,"MoveRenderset","La scene " & $scene & " est introuvable") Exit EndIf $ArFrames = _FileListToArray($dirframes) $frames = _ArrayToString( $ArFrames,@TAB, 0, 0 ) MsgBox(0, "", $frames) If @Error=1 Then MsgBox (16,"MoveRenderset","Le dossier ""frames"" est vide") Exit EndIf ; Déterminer la version de la scène $ArVersion = _FileListToArray($dirstage) _SelNumberFromStr() $version = StringRight('00' & _ArrayMax($ArVersion, 1), 3 ) MsgBox(0, 'Current Version', $version) $dirrenderset = "E:\Renderset\" & $episode & "\" & $episode & $scene & "_" & $version DirCreate($dirrenderset) FileMove($dirframes & "\*.tga", $dirrenderset & "\*.tga") $ArFrames = _FileListToArray($dirrenderset) $frames = _ArrayToString( $ArFrames,@TAB, 0, 0 ) _FileWriteLog(@ScriptDir & "\MoveRenderset.log","//-----------------------" & @CR & @CR & "Épisode: " & $episode & @CR & "Scène: " & $scene & @CR & "Version: " & $version & @CR & "Nb de frames: " & $frames & @CR & @CR & "Déplacement terminé -----------------------\\" & @CR & @CR & @CR) MsgBox(0, "MoveRenderset", "Épisode: " & $episode & @CR & "Scène: " & $scene & @CR & "Version: " & $version & @CR & "Nb de frames: " & $frames & @CR & @CR & "Déplacement terminé") $defepisode = $episode $defscene = $scene + 1 WEnd Func _SelNumberFromStr() For $i = 0 To UBound($ArVersion)-1 $number = _StringBetween($ArVersion[$i], 'v', '.') $ArVersion[$i] = Number($number[0]) ;Line 119 Next EndFunc Anyone knows what is wrong? Thanks.
-
Thank you GMK, I'll try that. Olivier.
-
BugFix, thank you for the code. I'm trying to understand it. I tried your code exactly as you posted and It worked. I tried to put it in my script but I get an error. Here is the error: CODELine 117 (File ... .au3"): $number = _StringBetween($ArVersion[$i], 'v', '.') $number = ^ERROR Error: Unknown function name. And here is my complete script. Line 117 is the fourth from the bottom. #Include <File.au3> #Include <Array.au3> $defepisode = IniRead(@ScriptDir & "\MoveRenderset.ini", "Parameters", "LastUsedEpisode", "aa") ;Lecture du denier episode dans le .ini $dir = "E:\usadata000" $defscene = "1" While 1 $episode = InputBox("MoveRenderset", "Quel épisode?", $defepisode , "") If @Error=1 Then Exit EndIf $episode = StringRight( $episode , 2) IniWrite(@ScriptDir & "\MoveRenderset.ini", "Parameters", "LastUsedEpisode", $episode) $direpisode = $dir & "\" & "go_" & $episode _FileListToArray($direpisode) If @Error=1 Then _FileWriteLog(@ScriptDir & "\MoveRenderset.log"," L'épisode " & $episode & " est introuvable" & @CR & @CR & @CR) MsgBox (16,"MoveRenderset","L'épisode " & $episode & " est introuvable") Exit EndIf $scene = InputBox("MoveRenderset", "Quel scène?", $defscene , "") If @Error=1 Then Exit EndIf ; Vérifie si la scène contient une lettre et trouve le numéro de scène. $scene = "00" & $scene $digit = StringIsDigit($scene) If $digit = 1 Then $scene = StringRight($scene, 3) Else $scene = StringRight($scene, 4) EndIf $dirscene = $direpisode & "\scene-" & $scene $dirframes = $dirscene & "\frames" $dirstage = $dirscene & "\stage" _FileListToArray($dirscene) If @Error=1 Then _FileWriteLog(@ScriptDir & "\MoveRenderset.log"," La scene " & $scene & " est introuvable" & @CR & @CR & @CR) MsgBox (16,"MoveRenderset","La scene " & $scene & " est introuvable") Exit EndIf $ArFrames = _FileListToArray($dirframes) $frames = _ArrayToString( $ArFrames,@TAB, 0, 0 ) MsgBox(0, "", $frames) If @Error=1 Then MsgBox (16,"MoveRenderset","Le dossier ""frames"" est vide") Exit EndIf ; Déterminer la version de la scène $ArVersion = _FileListToArray($dirstage) _SelNumberFromStr() $version = StringRight('00' & _ArrayMax($ArVersion, 1), 3 ) MsgBox(0, 'Current Version', $version) $dirrenderset = "E:\Renderset\" & $episode & "\" & $episode & $scene & "_" & $version DirCreate($dirrenderset) FileMove($dirframes & "\*.tga", $dirrenderset & "\*.tga") $ArFrames = _FileListToArray($dirrenderset) $frames = _ArrayToString( $ArFrames,@TAB, 0, 0 ) _FileWriteLog(@ScriptDir & "\MoveRenderset.log","//-----------------------" & @CR & @CR & "Épisode: " & $episode & @CR & "Scène: " & $scene & @CR & "Version: " & $version & @CR & "Nb de frames: " & $frames & @CR & @CR & "Déplacement terminé -----------------------\\" & @CR & @CR & @CR) MsgBox(0, "MoveRenderset", "Épisode: " & $episode & @CR & "Scène: " & $scene & @CR & "Version: " & $version & @CR & "Nb de frames: " & $frames & @CR & @CR & "Déplacement terminé") $defepisode = $episode $defscene = $scene + 1 WEnd Func _SelNumberFromStr() For $i = 0 To UBound($ArVersion)-1 $number = _StringBetween($ArVersion[$i], 'v', '.') ;line 117 $ArVersion[$i] = Number($number[0]) Next EndFunc My script is not optimal, I'm kind of new to AutoIt. Do you know why I get this error? Thank you, Olivier.
-
Hi, I have a bunch of file in a directory that represent the version of a scene in ToonBoom Harmony. Here are the files I have in the directory. v1.stage v10.stage v11.stage v12.stage v2.stage v3.stage v4.stage v5.stage v6.stage v7.stage v8.stage v9.stage v1.stage~ v10.stage~ v11.stage~ v12.stage~ v2.stage~ v3.stage~ v4.stage~ v5.stage~ v6.stage~ v7.stage~ v8.stage~ v9.stage~ I want my script to return the number of the highest version with 3 digits. Like this "012". But my script will return "009". If I have less than 10 versions, the script return the correct number. Here is my script: $ArVersion = _FileListToArray($dirstage) $version = StringRight("00" & StringMid(_ArrayMax( $ArVersion, 0, 1), 2, StringInStr(_ArrayMax( $ArVersion, 0, 1), ".") -2), 3) Anyone knows how to fix this? Thank you, Olivier.
-
The "bug" I had was not a bug. I needed to download the GDI+ redist since I'm on Windows 2k. I tested your script and it works perfectly. Thanks a lot. Olivier.
-
Hey PaulIA, I tried using Auto3Lib with a script called Lod3n Launcher. PNG as GUI, drop shadows, curved edges, you name it. I got the following error: --------------------------- AutoIt Error --------------------------- Line 2321 (File "C:\Program Files\AutoIt3\Include\A3LGDIPlus.au3"): Return $aResult[0] <> 0 Return $aResult^ ERROR Error: Subscript used with non-Array variable. --------------------------- OK --------------------------- I have Autoit v3.2.4.9 and the latest version of Auto3Lib (Downloaded July 3rd). lod3n believes it's a bug in Auto3Lib and he suggested to me to report a bug. So here I am. Could you get a look at it? Thank you, Olivier.
-
I get this error message: --------------------------- AutoIt Error --------------------------- Line 2321 (File "C:\Program Files\AutoIt3\Include\A3LGDIPlus.au3"): Return $aResult[0] <> 0 Return $aResult^ ERROR Error: Subscript used with non-Array variable. --------------------------- OK --------------------------- I'm using AutoIt v3.2.4.9 and Auto3Lib downloaded july 3rd (I don't know how to check the version). Any idea what's wrong? Thank you, Olivier. Edit: I got the same error with a script from lod3n and he believes it's a bug in Auto3Lib. I've ask PaulIA to take a look to be sure.
-
Hi, I've never messed with GUIs before. What I want to do is create a GUI that displays only a PNG, with no border, menu or "X" button. When I drag & drop files onto it, I want the path of the files stored into an array. Anybody can help me out? Thanks, 0livier.
-
PNG as GUI, drop shadows, curved edges, you name it
PERTU replied to lod3n's topic in AutoIt Example Scripts
When I try to run lod3n launcher.au3 I get this error: --------------------------- AutoIt Error --------------------------- Line 2321 (File "C:\Program Files\AutoIt3\Include\A3LGDIPlus.au3"): Return $aResult[0] <> 0 Return $aResult^ ERROR Error: Subscript used with non-Array variable. --------------------------- OK --------------------------- I have Autoit v3.2.4.9 and the latest version of Auto3Lib (Downloaded July 3rd). Anybody knows whats wrong? Thanks. Olivier. -
Thank you, It works like I wanted. I should'nt hesitate to use the same variable more often. Olivier.
-
Hi, I have an InputBox, and I want the script to exit if the cancel button is pressed. Here is the code for my InputBox: $scene = StringRight("00" & (InputBox("MoveRenderset", "Quel scène?", $defscene , "")),3)oÝ÷ Økçm+ºØßÛ'¢Ü(®H§ay"¶·º¹ì¶®º+¡ô®)àF(!µ«¢+ØÀÌØí͹ôMÑÉ¥¹I¥¡Ð ÅÕ½ÐìÀÀÅÕ½ÐìµÀì¡%¹ÁÕÑ ½à ÅÕ½Ðí5½ÙI¹ÉÍÐÅÕ½Ðì°ÅÕ½ÐíEÕ°Í¡¹üÅÕ½Ðì°ÀÌØí͹°ÅÕ½ÐìÅÕ½Ð줤°Ì¤)%ÉɽÈôÄQ¡¸(á¥Ð)¹% Anybody knows how to do it? Thanks, Olivier.
-
Return highest numerical value from an alphanumeric array
PERTU replied to PERTU's topic in AutoIt General Help and Support
In fact I wanted a 3 digit number. So for my example I want "5" to be returned as "005". I tried something that looks like Paulie idea: CODE $FileList = _FileListToArray($dirstage) $version = StringRight("00" & StringMid(_ArrayMax( $FileList, 0, 1), 2, StringInStr(_ArrayMax( $FileList, 0, 1), ".") -2), 3) msgbox( 0, "MoveRenderset", "La version est: "&$version) It seems to work alright, but will only work if the file keep the same structure. ie: "vX.stage". So I'll look at evilertoaster's code to see if I can understand it, and see if it works with any file structure, not just "vX.stage". Thanks to both of you, Olivier. edit: I'll also take a look at your code PsaltyDS. Thank you.