
Elishac
Active Members-
Posts
114 -
Joined
-
Last visited
Everything posted by Elishac
-
run function not working (beginner)
Elishac replied to Elishac's topic in AutoIt General Help and Support
Ok, thanks. -
run function not working (beginner)
Elishac replied to Elishac's topic in AutoIt General Help and Support
Hello, thanks for all these answers. I've tried quite a lot of different things that you mentionned, including : Run("'C:\documents and settings\elishac\Desktop\myprogram.exe'") Run("myprogram.exe", "C:\documents and settings\elishac\Desktop\") Run("myprogram.exe", @DesktopDir) Run(@DesktopDir & "myprogram.exe") and some others (I've tried so many I don't even remember). The only one that worked is FileChangeDir(@DesktopDir) Run("myprogram.exe") I don't understand why this is, and in particular I don't understand why it would work for Run("C:\program files\mozilla\firefox.exe") and not for Run("C:\documents and settings\elishac\Desktop\myprogram.exe"). I'm executing the .au3 from a folder that is located on the desktop. -
Hello, I'm trying to open a .exe file. The autoit source I created couldn't be any simpler (only 1 line) : Run("C:\documents and settings\elishac\Desktop\myprogram.exe") The result is that myprogram.exe flashes for 0.1 second and then disappears. This is not what I want. If I type the very same path in windows->run, it works. If I type Run("C:\program files\mozilla\firefox.exe") instead, it works as well. So I really don't understand why it wouldn't work for myprogram.exe. I don't know if this is relevant, but myprogram.exe was self-made using the sdl librairy. Can you help me to fix this issue ? Thanks.
-
I've tried it many ways but it doesn't work. Can you show me how you'd make it work please ? (where exactly in my code should i insert these sortings)
-
As far as I know I was never warned before !? I happen to have seen your signature and I did wait 24hours before adding a new response (you can check it), if that's what you call bumping. I'm following your rules so I don't see why you get upset like that. If I don't "bump" it, how are you supposed to know I'm still needing help and that I haven't managed to get around it on my own ? If I don't add an answer, the post will be forgotten in the mass of the new posts and I'm sure you'll never ever add a new comment here. I don't mean to be a smartass it's just that I don't understand why you say that when I'm following your rules. Anyway, that's just my opinion. There's no need to answer to this particular reply (it's completely off topic), I know you have better things to do and I'd rather you helped me with my script instead. I hope someone will be able to tell me how to get around the sorting issue where in "test1,test2,test10", i get instead "test1,test10,test2".
-
Can anybody please help me to finish my little script ?
-
>_
-
help
-
errrr... where exactly do I put it? in the _FilleditCurrent() function ? (besides, isn't array <> Array ?) Also, can't that sorting not modify the name of the files ? It would be best if it was just used in intern to sort the files correctly, without modifying them.
-
ok, let's try to do that until we find a better solution. how would we do it, and where would we insert it?
-
Ok, I've edited and corrected the mistake you pointed out. It works better now. The result isn't right though, and I know why : when the script makes the list of .avi files available, the list is made alphabetically. But sometimes people write "Lost - s1e1", "Lost - s1e2" and "Lost - s1e10", and therefore the second file in the list isn't "Lost - s1e2" but "Lost - s1e10". Do you have any idea how I could fix that ?
-
It's hard to say in a few words. I'll just give you the whole script. $Array[0] is the length of $Array, which contains all the .avi files in the script folder. The labels are in French, but I'm sure you can use wordreference or something like that, it doesn't matter much anyway. Just put the script in a directory that contains .avi files, and check the checkbox in the right. Then write "lost" (for instance) instead of "nom" (the name of the series) and press "voir les modifications" (see the changes). The idea of this whole script is to change all the names of the files of a show season at once. I want it to have the form : "Smallville - [01x02] - Vo - Metamorphosis.avi" where "smallville" is the name of the show, "01" is the season number, "02" is the episode number, and "metamorphosis" is the name of that episode. Look closely at line 275,398 and the last lines of the script. #Include <File.au3> #include <GUIConstants.au3> #include <Misc.au3> #include <string.au3> #include <Array.au3> #include <INet.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #NoTrayIcon opt("WinTitleMatchMode", 2) Opt("TrayIconHide", 1) Opt("GUIOnEventMode", 1) _Singleton ("N'utiliser qu'un seul Correcteur de Noms de Fichiers à la fois.") #Region Global Delcarations Global $version = "1.0 Beta" Global $paste Global $file Global $inpTrimFileread Global $inpSpecialTrimread Global $inpReplace1read Global $inpReplace2read Global $chkAdd Global $chkTrim Global $chkStripChars Global $inpAdd Global $inpTrimFile Global $inpSpecialTrim Global $chkRegExp Global $chkReplace Global $inpReplace1 Global $inpReplace2 Global $inpRegExp Global $chkSeries Global $inpName Global $inpNumber Global $chkradio1 Global $chkradio2 Global $chkradio3 Global $chkradio4 Global $chkradio5 Global $inpAutre Global $editChanged Global $chkStripTrackNumber Global $btnMakeChanges Global $editCurrent Global $chkUnderscores Global $chkFixDashes Global $EpisodeList #EndRegion _CreateGUI() _FilleditCurrent() GUISetState(@SW_SHOW) While 1 Sleep (100) WEnd Func _CreateGUI() GUICreate("Correcteur de Noms de Fichiers " & $version, 706, 580) GUISetOnEvent ($GUI_EVENT_CLOSE, "_GUI_EVENT_CLOSE") $editCurrent = GUICtrlCreateEdit("", 16, 10, 321, 281, -1, $WS_EX_CLIENTEDGE) $editChanged = GUICtrlCreateEdit("", 368, 10, 321, 281, -1, $WS_EX_CLIENTEDGE) GUICtrlCreateLabel("Modifications usuelles", 120, 302, 110, 20, -1, $SS_GRAYRECT) $chkAdd = GUICtrlCreateCheckbox("Ajouter", 16, 339, 50, 20) GUICtrlSetOnEvent (-1, "_chkAdd") $inpAdd = GUICtrlCreateInput("test", 75, 339, 100, 20, -1, $WS_EX_CLIENTEDGE) GUICtrlSetState(-1, $GUI_Disable) GUICtrlCreateLabel("au début du nom des fichiers", 185, 341, 150, 20) $chkTrim = GUICtrlCreateCheckbox("Supprimer", 16, 371, 70, 17) GUICtrlSetOnEvent (-1, "_chkTrim") $inpTrimFile = GUICtrlCreateInput("", 100, 371, 25, 20, -1, $WS_EX_CLIENTEDGE) GUICtrlSetState(-1, $GUI_Disable) GUICtrlCreateLabel("caractères au début du nom des fichiers", 137, 373, 190, 20) $chkStripChars = GUICtrlCreateCheckbox("Supprimer", 16, 403, 70, 20) GUICtrlSetOnEvent (-1, "_chkStripChars") $inpSpecialTrim = GUICtrlCreateInput("", 100, 403, 89, 20, -1, $WS_EX_CLIENTEDGE) GUICtrlSetState(-1, $GUI_Disable) GUICtrlCreateLabel("du nom des fichiers", 200, 405, 148, 20) ;$chkStripTrackNumber = GUICtrlCreateCheckbox("Remove Track numbers from filenames", 16, 412, 305, 20) $chkReplace = GUICtrlCreateCheckbox("Remplacer", 16, 435, 70, 20) GUICtrlSetOnEvent (-1, "_chkReplace") $inpReplace1 = GUICtrlCreateInput("", 100, 435, 89, 20, -1, $WS_EX_CLIENTEDGE) GUICtrlSetState(-1, $GUI_Disable) GUICtrlCreateLabel("par", 200, 437, 32, 20) $inpReplace2 = GUICtrlCreateInput("", 225, 435, 89, 20, -1, $WS_EX_CLIENTEDGE) GUICtrlSetState(-1, $GUI_Disable) ;$chkRegExp = GUICtrlCreateCheckbox("Strip Out Regular Expression", 16, 481, 155, 20) ;GUICtrlSetOnEvent (-1, "_chkRegExp") ;$inpRegExp = GUICtrlCreateInput ("", 180, 481, 410, 20) ;GUICtrlSetState(-1, $GUI_Disable) $chkUnderscores = GUICtrlCreateCheckbox('Remplacer les underscores "_" par des espaces', 16, 467, 250, 20) $chkFixDashes = GUICtrlCreateCheckbox('Remplacer "-" par " - " (ajouter des espaces)', 16, 499, 250, 20) GUICtrlCreateLabel("Modifications spécifiques aux séries TV", 430, 302, 193, 20, -1, $SS_GRAYRECT) $chkSeries = GUICtrlCreateCheckbox("Utiliser les modifications spécifiques aux séries TV", 368, 339, 280, 20) GUICtrlSetOnEvent (-1, "_chkSeries") GUICtrlCreateLabel("Nom de la série", 388, 373, 100, 20) $inpName = GUICtrlCreateInput("Nom", 500, 371, 100, 20, -1, $WS_EX_CLIENTEDGE) GUICtrlSetState(-1, $GUI_Disable) GUICtrlCreateLabel("Numéro de la saison", 388, 405, 100, 20) $inpNumber = GUICtrlCreateInput("1", 500, 403, 25, 20, -1, $WS_EX_CLIENTEDGE) GUICtrlSetState(-1, $GUI_Disable) GUICtrlCreateLabel("Langues et sous-titres", 388, 437, 120, 20) $chkradio1 = GUICtrlCreateRadio("Vo", 410, 465, 35, 20) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetState(-1, $GUI_Disable) GUICtrlSetOnEvent (-1, "_chkradio5") $chkradio2 = GUICtrlCreateRadio("Vf", 447, 465, 35, 20) GUICtrlSetState(-1, $GUI_Disable) GUICtrlSetOnEvent (-1, "_chkradio5") $chkradio3 = GUICtrlCreateRadio("Vostfr", 484, 465, 49, 20) GUICtrlSetState(-1, $GUI_Disable) GUICtrlSetOnEvent (-1, "_chkradio5") $chkradio4 = GUICtrlCreateRadio("Vosten", 539, 465, 49, 20) GUICtrlSetState(-1, $GUI_Disable) GUICtrlSetOnEvent (-1, "_chkradio5") $chkradio5 = GUICtrlCreateRadio("Autre", 599, 465, 44, 20) GUICtrlSetState(-1, $GUI_Disable) GUICtrlSetOnEvent (-1, "_chkradio5") $inpAutre = GUICtrlCreateInput("", 645, 463, 40, 20, -1, $WS_EX_CLIENTEDGE) GUICtrlSetState(-1, $GUI_Disable) ;~ GUICtrlCreateLabel("Nom des épisodes", 388, 501, 80, 20) ;~ $btnAutoSearch = GUICtrlCreateButton("Recherche automatique", 470, 501) ;~ GUICtrlSetOnEvent (-1, "_btnManualSearch") $btnShowMe = GUICtrlCreateButton("Voir les modifications", 230, 550) GUICtrlSetOnEvent (-1, "_btnShowMe") GUICtrlSetState (-1, $GUI_DEFBUTTON) $btnMakeChanges = GUICtrlCreateButton("Appliquer les modifications", 345, 550) GUICtrlSetOnEvent (-1, "_btnMakeChanges") GUICtrlSetState(-1, $GUI_Disable) ControlFocus ( "Correcteur de noms de fichiers", "", $btnShowMe ) EndFunc #Region GUI Functions Func _btnShowMe() ShowMeMakeChanges("Show") EndFunc Func _btnMakeChanges() ShowMeMakeChanges("Change") EndFunc Func _chkAdd() If GUICtrlRead($chkAdd) = $GUI_CHECKED Then GUICtrlSetState($inpAdd, $GUI_Enable) ElseIf GUICtrlRead($chkAdd) = $GUI_UNCHECKED Then GUICtrlSetState($inpAdd, $GUI_Disable) EndIf EndFunc Func _chkTrim() If GUICtrlRead($chkTrim) = $GUI_CHECKED Then GUICtrlSetState($inpTrimFile, $GUI_Enable) ElseIf GUICtrlRead($chkTrim) = $GUI_UNCHECKED Then GUICtrlSetState($inpTrimFile, $GUI_Disable) EndIf EndFunc Func _chkStripChars() If GUICtrlRead($chkStripChars) = $GUI_CHECKED Then GUICtrlSetState($inpSpecialTrim, $GUI_Enable) ElseIf GUICtrlRead($chkStripChars) = $GUI_UNCHECKED Then GUICtrlSetState($inpSpecialTrim, $GUI_Disable) EndIf EndFunc Func _chkReplace() If GUICtrlRead($chkReplace) = $GUI_CHECKED Then GUICtrlSetState($inpReplace1, $GUI_Enable) GUICtrlSetState($inpReplace2, $GUI_Enable) ElseIf GUICtrlRead($chkReplace) = $GUI_UNCHECKED Then GUICtrlSetState($inpReplace1, $GUI_Disable) GUICtrlSetState($inpReplace2, $GUI_Disable) EndIf EndFunc Func _chkRegExp() If GUICtrlRead($chkRegExp) = $GUI_CHECKED Then GUICtrlSetState($inpRegExp, $GUI_Enable) ElseIf GUICtrlRead($chkRegExp) = $GUI_UNCHECKED Then GUICtrlSetState($inpRegExp, $GUI_Disable) EndIf EndFunc Func _chkSeries() If GUICtrlRead($chkSeries) = $GUI_CHECKED Then GUICtrlSetState($inpName, $GUI_Enable) GUICtrlSetState($inpNumber, $GUI_Enable) GUICtrlSetState($chkradio1, $GUI_Enable) GUICtrlSetState($chkradio2, $GUI_Enable) GUICtrlSetState($chkradio3, $GUI_Enable) GUICtrlSetState($chkradio4, $GUI_Enable) GUICtrlSetState($chkradio5, $GUI_Enable) ElseIf GUICtrlRead($chkSeries) = $GUI_UNCHECKED Then GUICtrlSetState($inpName, $GUI_Disable) GUICtrlSetState($inpNumber, $GUI_Disable) GUICtrlSetState($chkradio1, $GUI_Disable) GUICtrlSetState($chkradio2, $GUI_Disable) GUICtrlSetState($chkradio3, $GUI_Disable) GUICtrlSetState($chkradio4, $GUI_Disable) GUICtrlSetState($chkradio5, $GUI_Disable) EndIf EndFunc Func _chkradio5() If GUICtrlRead($chkradio5) = $GUI_CHECKED Then GUICtrlSetState($inpAutre, $GUI_Enable) ElseIf GUICtrlRead($chkradio5) = $GUI_UNCHECKED Then GUICtrlSetState($inpAutre, $GUI_Disable) EndIf EndFunc Func _GUI_EVENT_CLOSE() Exit EndFunc #EndRegion Func _FilleditCurrent() $FileList = _FileListToArray (@ScriptDir, "*.avi", 1) If @error Then MsgBox ( 0, "Pas de fichiers .avi dans ce dossier", "Il n'y a pas de fichiers .avi dans ce dossier. Mettre le Correcteur de Noms de Fichiers dans un dossier contenant des fichiers .avi et réessayer" ) Exit EndIf Dim $munge For $x = 1 to $FileList[0] $munge &= $FileList[$x] & @CRLF Next GUICtrlSetData($editCurrent, $munge) EndFunc Func ShowMeMakeChanges($ActionRequired) If $ActionRequired = "Show" Then Dim $munge = "" GUICtrlSetData($editChanged, "") $Array = _FileListToArray (@ScriptDir, "*.avi", 1) If @error Then Exit If GUICtrlRead($chkSeries) = $GUI_CHECKED Then $EpisodeList=_AutoSearch(GUICtrlRead($inpName),GUICtrlRead($inpNumber)) EndIf For $x = 1 To $Array[0] $munge &= Rename($Array[$x],$x) & @CRLF Next GUICtrlSetData($editChanged, $munge) GUICtrlSetState($btnMakeChanges, $GUI_Enable) GUICtrlSetState($btnMakeChanges, $GUI_DEFBUTTON) ElseIf $ActionRequired = "Change" Then $Array = _FileListToArray (@ScriptDir, "*.avi", 1) If @error Then Exit If GUICtrlRead($chkSeries) = $GUI_CHECKED Then $EpisodeList=_AutoSearch(GUICtrlRead($inpName),GUICtrlRead($inpNumber)) EndIf For $x = 1 To $Array[0] FileMove($Array[$x], Rename($Array[$x],$x), 1) Next MsgBox(0, "Résultat", "Modifications effectuées !", 3) GUICtrlSetData ($editChanged, "") GUICtrlSetData ($editCurrent, "") GUICtrlSetState($btnMakeChanges, $GUI_Disable) _FilleditCurrent() GUICtrlSetState ($chkAdd, $GUI_UNCHECKED) GUICtrlSetState ($chkTrim, $GUI_UNCHECKED) GUICtrlSetState ($chkStripChars, $GUI_UNCHECKED) GUICtrlSetState ($chkStripTrackNumber, $GUI_UNCHECKED) GUICtrlSetState ($chkReplace, $GUI_UNCHECKED) GUICtrlSetState ($chkRegExp, $GUI_UNCHECKED) GUICtrlSetState ($chkUnderscores, $GUI_UNCHECKED) GUICtrlSetState ($chkFixDashes, $GUI_UNCHECKED) GUICtrlSetData ($inpAdd, "") GUICtrlSetData ($inpTrimFile, "") GUICtrlSetData ($inpSpecialTrim, "") GUICtrlSetData ($inpReplace1, "") GUICtrlSetData ($inpReplace2, "") GUICtrlSetData ($inpRegExp, "") GuiCtrlSetState ($inpAdd, $GUI_Disable) GuiCtrlSetState ($inpTrimFile, $GUI_Disable) GuiCtrlSetState ($inpSpecialTrim, $GUI_Disable) GuiCtrlSetState ($inpReplace1, $GUI_Disable) GuiCtrlSetState ($inpReplace2, $GUI_Disable) GuiCtrlSetState ($inpRegExp, $GUI_Disable) EndIf EndFunc ;==>MakeChanges Func Rename($file,$x) If GUICtrlRead($chkAdd) = $GUI_CHECKED Then $file = GUICtrlRead($inpAdd) & $file EndIf If GUICtrlRead($chkTrim) = $GUI_CHECKED Then If GUICtrlRead($inpTrimFile) = "" Then $inpTrimFileread = 0 $file = StringTrimLeft($file, GUICtrlRead($inpTrimFile)) EndIf If GUICtrlRead($chkStripChars) = $GUI_CHECKED Then If GUICtrlRead($inpSpecialTrim) <> "" Then $file = StringReplace($file, GUICtrlRead($inpSpecialTrim), "", 0, 1) EndIf EndIf If GUICtrlRead($chkStripTrackNumber) = $GUI_CHECKED Then $file = StringRegExpReplace($file, "(?:\s|\A)([0-9]{1,3})(?:\s|\z)", "") EndIf If GUICtrlRead($chkReplace) = $GUI_CHECKED Then $inpReplace1read = GUICtrlRead($inpReplace1) $inpReplace2read = GUICtrlRead($inpReplace2) $file = StringReplace($file, $inpReplace1read, $inpReplace2read) EndIf If GUICtrlRead($chkRegExp) = $GUI_CHECKED Then If StringRegExp ($file, GUICtrlRead ($inpRegExp), 0) Then $RegExp = StringRegExp ($file, GUICtrlRead ($inpRegExp), 1) $file = StringReplace($file, $RegExp[0], "") EndIf EndIf If GUICtrlRead($chkUnderscores) = $GUI_CHECKED Then $file = StringReplace ($file, "_", " ") EndIf If GUICtrlRead($chkFixDashes) = $GUI_CHECKED Then $file = StringReplace ($file, "-", " - ", 1) EndIf $file = _StringProper($file) If GUICtrlRead($chkSeries) = $GUI_CHECKED Then Local $tmp_inpNumber If Number(GUICtrlRead($inpNumber)) < 10 Then $tmp_inpNumber="0" & String(Number(GUICtrlRead($inpNumber))) Else $tmp_inpNumber=String(Number(GUICtrlRead($inpNumber))) EndIf Local $y If $x<10 Then $y="0" & String($x) Else $y=String($x) EndIf Local $language If GUICtrlRead($chkradio1) = $GUI_CHECKED Then $language="Vo" ElseIf GUICtrlRead($chkradio2) = $GUI_CHECKED Then $language="Vf" ElseIf GUICtrlRead($chkradio3) = $GUI_CHECKED Then $language="Vostfr" ElseIf GUICtrlRead($chkradio4) = $GUI_CHECKED Then $language="Vosten" ElseIf GUICtrlRead($chkradio5) = $GUI_CHECKED Then $language=GUICtrlRead($inpAutre) EndIf $file = _StringProper(GUICtrlRead($inpName)) & " - [" & $tmp_inpNumber & "x" & $y & "] - " & _StringProper($language) & " - " & $EpisodeList[$x-1] & ".avi" EndIf $file = StringReplace($file, "Id ", "I'd ", 0, 1) $file = StringReplace($file, "Nobodys ", "Nobody's ", 0, 1) $file = StringReplace($file, "Aint ", "Ain't ", 0, 1) $file = StringReplace($file, "Youre ", "You're ", 0, 1) $file = StringReplace($file, "Ol ", "Ol' ", 0, 1) $file = StringReplace($file, "Im ", "I'm ", 0, 1) $file = StringReplace($file, "Ill ", "I'll ", 0, 1) $file = StringReplace($file, "Cant ", "Can't ", 0, 1) $file = StringReplace($file, "Dont ", "Don't ", 0, 1) $file = StringReplace($file, ".Mp3", ".mp3", 0, 1) $file = StringReplace($file, ".AVI", ".avi", 0, 1) $file = StringReplace($file, ".AVI", ".avi", 0, 1) If StringRegExp($file, "[[:word:]]'[[:upper:]]", 0) Then $RegExp = StringRegExp($file, "(?:[[:word:]]')([[:upper:]])", 4) For $i = 0 To UBound($RegExp) - 1 $match = $RegExp[$i] $file = StringReplace ($file, "'" & $match[1], "'" & StringLower($match[1]), 0, 1) Next EndIf If StringRegExp ($file, "'[[:upper:]]", 0) Then $RegExp = StringRegExp ($file, "'[[:upper:]]", 3) For $x = 1 to UBound($RegExp)-1 $file = StringReplace ($file, $RegExp[$x], StringLower($RegExp[$x])) Next EndIf If StringRegExp ($file, "\s'[[:lower:]]", 0) Then $RegExp = StringRegExp ($file, "\s'[[:lower:]]", 3) For $x = 1 to UBound($RegExp)-1 $file = StringReplace ($file, $RegExp[$x], StringUpper($RegExp[$x])) Next EndIf $file = StringReplace($file, ".Avi", ".avi", 0, 1) $file = StringStripWS ( $file, 5 ) Return $file EndFunc ;==>Rename Func _AutoSearch($inpName,$inpNumber) If $inpName= "" Then MsgBox(16, "AutoSearch Error", "You didn't enter the name of the show") Local $iShowID = _GetShowID($inpName) Local $sURL = "http://services.tvrage.com/feeds/episode_list.php?sid=" & $iShowID Local $sSource = _INetGetSource($sURL) If $inpNumber="" Then MsgBox(16, "AutoSearch Error", "You didn't enter the season number") Local $sStart = '<Season no="' & $inpNumber & '">' Local $sEnd = "</Season>" Local $sSeasonInfo = _StringBetween($sSource, $sStart, $sEnd) Local $aEpisodeList = StringRegExp($sSeasonInfo[0], "(?s)(?i)<Title>(.*?)</Title>", 3) Return $aEpisodeList EndFunc ;==>_AutoSearch Func _GetShowID($inpName) Local $sURL = "http://services.tvrage.com/tools/quickinfo.php?show=" & $inpName Local $sSource = _INetGetSource($sURL) Local $aSource = StringSplit($sSource, @CRLF, 2) $aSource = StringSplit($aSource[0], "@", 2) Local $iShowID = $aSource[1] Return $aSource[1] EndFunc ;==>_GetShowID
-
The part you wrote works for me too, but as soon as I insert it in my script, it doesn't work anymore. I use it this way : $EpisodeList=_AutoSearch($inpName,$inpNumber) For $x = 1 To $Array[0] "..." & $EpisodeList[$x-1] & "..." and it displays the error I wrote earlier.
-
yes, i chose season 1. This is what I wrote : Func _AutoSearch($inpName,$inpNumber) If $inpName= "" Then MsgBox(16, "AutoSearch Error", "You didn't enter the name of the show") Local $iShowID = _GetShowID($inpName) Local $sURL = "http://services.tvrage.com/feeds/episode_list.php?sid=" & $iShowID Local $sSource = _INetGetSource($sURL) If $inpNumber="" Then MsgBox(16, "AutoSearch Error", "You didn't enter the season number") Local $sStart = '<Season no="' & $inpNumber & '">' Local $sEnd = "</Season>" Local $sSeasonInfo = _StringBetween($sSource, $sStart, $sEnd) Local $aEpisodeList = StringRegExp($sSeasonInfo[0], "(?s)(?i)<Title>(.*?)</Title>", 3) $aEpisodeList EndFunc ;==>_AutoSearch Func _GetShowID($inpNumber) Local $sURL = "http://services.tvrage.com/tools/quickinfo.php?show=" & $inpNumber Local $sSource = _INetGetSource($sURL) Local $aSource = StringSplit($sSource, @CRLF, 2) $aSource = StringSplit($aSource[0], "@", 2) Local $iShowID = $aSource[1] Return $aSource[1] EndFunc ;==>_GetShowID
-
When I adapt your code to my script, I get this error : Local $aEpisodeList = StringRegExp($sSeasonInfo[0], "(?s)(?i)<Title>(.*?)</Title>", 3) Info^ ERROR error: Subscript used with non-Array variable.
-
Ok, so let's say I have the source. How do I extract the episode list (and put it in an array) from the source ? I never used StringRegExp() before and I don't understand the help file very much.
-
ok thanks. Can you help me a little bit more please ? Like, let's say the show is called $name and the season I'm looking for is $number. How do I get the list of episodes ? Do I need to use ctrl+ F in the IE window ? By the way, is there a way to use the informations on Internet without having to open a IE window (if it's hidden or if the page is downloaded completely or something like that?)
-
Yeah, I know it depends on the site, and that's why it is so difficult. I mean, I can read the IE UDF, (I already did), but it's hard to remember them all, and thus it's hard for me to figure out how I can extract the information. Let's take this page for instance : http://en.wikipedia.org/wiki/List_of_Lost_episodes (or this one : http://en.wikipedia.org/wiki/List_of_24_episodes) What functions do you think I could use to extract the list of the episode names of the season 2 ? The functions need to be quite unspecific, so that the idea could be used into another webpage of the same style, and that's why it's so difficult and that's why I need your help.
-
Hi, I'd like to make a script that opens internet explorer and searches automatically the list of the episode names of a given tv series. The 2 arguments of the function would be the name of the tv series and the number of the season. Do you have any idea as to how to do that ? Any help would be very much appreciated. Regards.
-
ok, thanks.
-
Hi. I have a GUI where there are 3 radios. Let's say the question is "how old are you", and $radio1 says 10, while $radio2 says 20. I'd like $radio3 to be an input square where you can put your age if it's neither 10 nor 20. I'd like this square to be gray (GUICtrlSetState(-1, $GUI_Disable)) unless $radio3 is checked. My problem is that if I click on $radio3 then on $radio2, the input square is "enabled" but I'd like it to become "disabled" again. I hope you have understood my question and I hope you'll be able to help me, as I believe my script is too long and too complicated to be posted here. Regards.
-
Ok, I've done it, I hope it is what you want, as it was hard to do. The number I want to extract is on the image1.PNG (which should be on a attachment file). The number can't be modified, but it can be copy/pasted, because, if you click it twice, the number gets selected. My question is still the same : how to extract that number ?