This is the script I try to run:
C
$_FF_COM_TRACE = True
#include <MsgBoxConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <FF.au3>
#include <staticConstants.au3>
#include <IE.au3>
#include <String.au3>
#include <Excel.au3>
#include <FileConstants.au3>
#include <IE.au3>
#include <String.au3>
#include <GUIConstantsEx.au3>
#include "GUIExtender.au3"
#Region ### START Koda GUI section ### Form=
$Form1_1_1_1 = GUICreate("form", 814, 713, 697, 101)
_GUIExtender_Init($Form1_1_1_1)
$List1 = GUICtrlCreateList("", 0, 64, 145, 358)
GUICtrlSetData(-1, "")
$List2 = GUICtrlCreateList("", 144, 64, 65, 358)
GUICtrlSetData(-1, "")
$List3 = GUICtrlCreateList("", 208, 64, 65, 358)
GUICtrlSetData(-1, "")
$List4 = GUICtrlCreateList("", 344, 64, 153, 358)
GUICtrlSetData(-1, "")
$List5 = GUICtrlCreateList("", 496, 64, 65, 358)
GUICtrlSetData(-1, "")
$List6 = GUICtrlCreateList("", 560, 64, 121, 230)
GUICtrlSetData(-1, "")
$List7 = GUICtrlCreateList("", 680, 64, 65, 230)
GUICtrlSetData(-1, "")
$List8 = GUICtrlCreateList("", 744, 64, 65, 230)
GUICtrlSetData(-1, "")
$List9 = GUICtrlCreateList("", 272, 64, 65, 358)
GUICtrlSetData(-1, "")
GUISetState(@SW_SHOW)
;~ $extand = GUICtrlCreateButton("extand", 504, 32, 65, 33)
;~ $iEdit_Section_Start = 30
;~ $iEdit_Section_Height = 250
$iEdit_Section_Start = 30
$iEdit_Section_Height = 210
$iEdit_Section = _GUIExtender_Section_Start($Form1_1_1_1, $iEdit_Section_Start, $iEdit_Section_Height)
_GUIExtender_Section_Action($Form1_1_1_1, $iEdit_Section)
; All control positions can then be related to the section start rather than the GUI <<<<<<<<<<<<<
; Now you can check that the _Section_Height is correct and amend if necessary <<<<<<<<<<<<<
_GUIExtender_Section_End($Form1_1_1_1)
_GUIExtender_Section_Extend($Form1_1_1_1, 0, False)
$sPath = @desktopdir & '\autoit\twitter programma\lijsten\lijsten2\'
$hSearch = FileFindFirstFile($sPath & '*.*')
local $mFiles = guictrlcreatemenu('&File')
local $List_Start = guictrlcreatedummy() + 1
While True
$sFile = FileFindNextFile($hSearch)
If @error Then ExitLoop
GUICtrlCreateMenuItem($sFile, $mFiles)
WEnd
local $List_End = guictrlcreatedummy() - 1
GUISetState()
local $iMSG
while 1
$iMSG = guigetmsg()
switch $iMSG
case $gui_event_close
Exit
case $List_Start to $List_End
ConsoleWrite('Clicked = ' & guictrlread($iMSG,1) & @CRLF)
$list1 = ("\list1.txt")
$list2 = ("\list2.txt")
$list3 = ("\list3.txt")
$list4 = ("\list4.txt")
$list5 = ("\list5.txt")
$list6 = ("\list6.txt")
$list7 = ("\list7.txt")
$list8 = ("\list8.txt")
$list9 = ("\list9.txt")
$list10 = ("\list10.txt")
$list11 = ("\list11.txt")
$list12 = ("\list12.txt")
$list13 = ("\list13.txt")
$opgeslagen = @desktopdir & 'C:\Users\joesoef pc\Desktop\autoit\programma\lijsten\lijsten2\'
$laden = guictrlread($iMSG,1) & @CRLF
MsgBox(1,"file:","" & $opgeslagen & $laden & $list1)
Global $iIndex = 0, $sListData1 = ($opgeslagen & $laden & $list1)
Global $sListFile1 = ($opgeslagen & $laden & $list1)
Global $iIndex = 0, $sListData2 = ($opgeslagen & $laden & $list2)
Global $sListFile2 = ($opgeslagen & $laden & $list2)
Global $iIndex = 0, $sListData3 = ($opgeslagen & $laden & $list3)
Global $sListFile3 = ($opgeslagen & $laden & $list3)
Global $iIndex = 0, $sListData4 = ($opgeslagen & $laden & $list4)
Global $sListFile4 = ($opgeslagen & $laden & $list4)
Global $iIndex = 0, $sListData5 = ($opgeslagen & $laden & $list5)
Global $sListFile5 = ($opgeslagen & $laden & $list4)
Global $iIndex = 0, $sListData6 = ($opgeslagen & $laden & $list6)
Global $sListFile6 = ($opgeslagen & $laden & $list6)
Global $iIndex = 0, $sListData7 = ($opgeslagen & $laden & $list7)
Global $sListFile7 = ($opgeslagen & $laden & $list7)
Global $iIndex = 0, $sListData8 = ($opgeslagen & $laden & $list8)
Global $sListFile8 = ($opgeslagen & $laden & $list8)
Global $iIndex = 0, $sListData9 = ($opgeslagen & $laden & $list9)
Global $sListFile9 = ($opgeslagen & $laden & $list9)
Global $iIndex = 0, $sListData10 = ($opgeslagen & $laden & $list10)
Global $sListFile10 = ($opgeslagen & $laden & $list10)
Global $iIndex = 0, $sListData11 = ($opgeslagen & $laden & $list11)
Global $sListFile11 = ($opgeslagen & $laden & $list11)
Global $iIndex = 0, $sListData12 = ($opgeslagen & $laden & $list12)
Global $sListFile12 = ($opgeslagen & $laden & $list12)
Global $iIndex = 0, $sListData13 = ($opgeslagen & $laden & $list13)
Global $sListFile13 = ($opgeslagen & $laden & $list13)
If FileExists($sListFile1) Then
$sListData1 = FileRead($sListFile1)
EndIf
GUICtrlSetData($List1, $sListData1)
_GUICtrlListBox_SetCurSel($List1, $iIndex)
If FileExists($sListFile2) Then
$sListData2 = FileRead($sListFile2)
EndIf
; Load data read from the file
GUICtrlSetData($List2, $sListData2)
_GUICtrlListBox_SetCurSel($List2, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile3) Then
$sListData3 = FileRead($sListFile3)
EndIf
; Load data read from the file
GUICtrlSetData($List3, $sListData3)
_GUICtrlListBox_SetCurSel($List3, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile4) Then
$sListData4 = FileRead($sListFile4)
EndIf
; Load data read from the file
GUICtrlSetData($List4, $sListData4)
_GUICtrlListBox_SetCurSel($List4, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile5) Then
$sListData5 = FileRead($sListFile5)
EndIf
; Load data read from the file
GUICtrlSetData($List5, $sListData5)
_GUICtrlListBox_SetCurSel($List5, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile6) Then
$sListData6 = FileRead($sListFile6)
EndIf
; Load data read from the file
GUICtrlSetData($List6, $sListData6)
_GUICtrlListBox_SetCurSel($List6, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile7) Then
$sListData7 = FileRead($sListFile7)
EndIf
; Load data read from the file
GUICtrlSetData($List7, $sListData7)
_GUICtrlListBox_SetCurSel($List7, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile8) Then
$sListData8 = FileRead($sListFile8)
EndIf
; Load data read from the file
GUICtrlSetData($List8, $sListData8)
_GUICtrlListBox_SetCurSel($List8, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile9) Then
$sListData9 = FileRead($sListFile9)
EndIf
; Load data read from the file
GUICtrlSetData($List9, $sListData9)
_GUICtrlListBox_SetCurSel($List9, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile10) Then
$sListData10 = FileRead($sListFile10)
EndIf
EndSwitch
wend
Alles anzeigen
If i do this (the old way) it works pefrect but it only opens the same file every time:
Code
$Form1_1_1_1 = GUICreate("form", 814, 713, 697, 101)
$List1 = GUICtrlCreateList("", 0, 64, 145, 358)
GUICtrlSetData(-1, "")
$List2 = GUICtrlCreateList("", 144, 64, 65, 358)
GUICtrlSetData(-1, "")
$List3 = GUICtrlCreateList("", 208, 64, 65, 358)
GUICtrlSetData(-1, "")
$List4 = GUICtrlCreateList("", 344, 64, 153, 358)
GUICtrlSetData(-1, "")
$List5 = GUICtrlCreateList("", 496, 64, 65, 358)
GUICtrlSetData(-1, "")
$List6 = GUICtrlCreateList("", 560, 64, 121, 230)
GUICtrlSetData(-1, "")
$List7 = GUICtrlCreateList("", 680, 64, 65, 230)
GUICtrlSetData(-1, "")
$List8 = GUICtrlCreateList("", 744, 64, 65, 230)
GUICtrlSetData(-1, "")
$List9 = GUICtrlCreateList("", 272, 64, 65, 358)
GUICtrlSetData(-1, "")
#EndRegion ### END Koda GUI section ###
Global $iIndex = 0, $sListData1 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list1.txt"
Global $sListFile1 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list1.txt"
Global $iIndex = 0, $sListData2 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list2.txt"
Global $sListFile2 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list2.txt"
Global $iIndex = 0, $sListData3 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list3.txt"
Global $sListFile3 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list3.txt"
Global $iIndex = 0, $sListData4 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list4.txt"
Global $sListFile4 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list4.txt"
Global $iIndex = 0, $sListData5 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list5.txt"
Global $sListFile5 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list5.txt"
Global $iIndex = 0, $sListData6 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list6.txt"
Global $sListFile6 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list6.txt"
Global $iIndex = 0, $sListData7 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list7.txt"
Global $sListFile7 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list7.txt"
Global $iIndex = 0, $sListData8 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list8.txt"
Global $sListFile8 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list8.txt"
Global $iIndex = 0, $sListData9 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list9.txt"
Global $sListFile9 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list9.txt"
Global $iIndex = 0, $sListData10 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list10.txt"
Global $sListFile10 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list10.txt"
Global $iIndex = 0, $sListData11 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list11.txt"
Global $sListFile11 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list11.txt"
Global $iIndex = 0, $sListData12 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list12.txt"
Global $sListFile12 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list12.txt"
Global $iIndex = 0, $sListData13 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list13.txt"
Global $sListFile13 = "C:\Users\joesoef pc\Desktop\autoit\twitter programma\lijsten\list13.txt"
; Read saved file if it exists--------
If FileExists($sListFile1) Then
$sListData1 = FileRead($sListFile1)
EndIf
; Load data read from the file
GUICtrlSetData($List1, $sListData1)
_GUICtrlListBox_SetCurSel($List1, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile2) Then
$sListData2 = FileRead($sListFile2)
EndIf
; Load data read from the file
GUICtrlSetData($List2, $sListData2)
_GUICtrlListBox_SetCurSel($List2, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile3) Then
$sListData3 = FileRead($sListFile3)
EndIf
; Load data read from the file
GUICtrlSetData($List3, $sListData3)
_GUICtrlListBox_SetCurSel($List3, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile4) Then
$sListData4 = FileRead($sListFile4)
EndIf
; Load data read from the file
GUICtrlSetData($List4, $sListData4)
_GUICtrlListBox_SetCurSel($List4, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile5) Then
$sListData5 = FileRead($sListFile5)
EndIf
; Load data read from the file
GUICtrlSetData($List5, $sListData5)
_GUICtrlListBox_SetCurSel($List5, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile6) Then
$sListData6 = FileRead($sListFile6)
EndIf
; Load data read from the file
GUICtrlSetData($List6, $sListData6)
_GUICtrlListBox_SetCurSel($List6, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile7) Then
$sListData7 = FileRead($sListFile7)
EndIf
; Load data read from the file
GUICtrlSetData($List7, $sListData7)
_GUICtrlListBox_SetCurSel($List7, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile8) Then
$sListData8 = FileRead($sListFile8)
EndIf
; Load data read from the file
GUICtrlSetData($List8, $sListData8)
_GUICtrlListBox_SetCurSel($List8, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile9) Then
$sListData9 = FileRead($sListFile9)
EndIf
; Load data read from the file
GUICtrlSetData($List9, $sListData9)
_GUICtrlListBox_SetCurSel($List9, $iIndex)
; Read saved file if it exists--------
If FileExists($sListFile10) Then
$sListData10 = FileRead($sListFile10)
EndIf
Alles anzeigen
What im tryind to do is to load the filles 'C:\Users\joesoef pc\Desktop\autoit\programma\lijsten\lijsten2\variablemap\list1.txt'
so when it starts up it doens't automaticly only opens :"C:\Users\joesoef pc\Desktop\autoit\programma\lijsten\list8.txt" like in the old script (above second script)
so before it loads I go to $mFiles the $mFiles DOES shown all the file in the lijsten2 map then I click on map for example: map august, it says : Clicked = August
just like you coded for me then it shows a message with the directory, but then it doesnt load the content I clicked.
I realy dont know what I am doing wrong??