2 posts in this topic
Is there anyway to store word documents in Autoit GUI? For example I have a instruction sheet that I want to bundle up with the exe.
So a user simply clicks the icon and the stored document will launch (Something like how you can add objects like excel sheets in word documents )
(I Know we can launch word files from script directory)
My AutoIT is pretty terrible - but I get by with trawling here
I came across an issue where i had to parse a large key in a large ini file, and found that I was victim of inireadsection's limit of "Only the first 32767 chars are read for legacy reasons."
I've attempted to put together some terrible code that parses an ini section.
It's absolutely nowhere near good, but I figured I'd put it here so that folk who know what they're doing can laugh at improve it.
$Ini = @ScriptDir & "\bigini.ini" Dim $IniArray $KeyName = "Person" $R = FileOpen($Ini, 0) $IniStr = FileRead($R) FileClose($R) $Start = StringInStr($iniStr, "[" & $KeyName & "]") If $Start = 0 then Msgbox(16, "Error", "String not found") Exit EndIf $Stop = StringInStr($IniStr, @CRLF & "[", 0, 1, ($Start + 1)) If $Stop = 0 then $Stop = StringLen($IniStr) EndIf $String = StringMid($IniStr, $Start, ($Stop - $Start)) $Split = StringSplit($String, @CRLF, 1) $KeyCount = 0 Dim $IniArray For $Loop = 1 to $Split $Add = "Y" $Str = $Split[$Loop] $EQBreak = StringInStr($Str, "=") Select Case StringMid($Str, 1, 1) = ";" $Add = "N" Case $EQBreak = 0 $Add = "N" Case Else $Add = "Y" EndSelect If $Add = "Y" then $KeyCount = $KeyCount + 1 $Key = StringMid($Str, 1, ($EQBreak - 1)) $Val = StringMid($Str, ($EQBreak + 1)) $IniArray[$KeyCount] = $Key $IniArray[$KeyCount] = $Val EndIf Next Redim $IniArray[$KeyCount +1] ; Add the number of hits to 00 to match inireadsection $IniArray = $KeyCount _ArrayDisplay($IniArray) ; Do stuff with the Array like you would inireadsection
very propably this has been asked before, well, I miss the thread(s) ...
Is there a command line switch to tell the SciTE setup EXE to install silently ("/S") *AND* to end up with "edit" (instead of "run") as system wide default action for *.au3 files?
As it can be done with the config tool:
I'm too stupid to see my mistake:
To investigate the internal "dictionary" of TIFF files I'd like to read in the files in binary mode and to check, if there are more than one pages "in" this TIFF.
Notepad++, "View as Hex" is presenting the first bytes as "49 49 2a 20 08 20 20 20 12" for the TIF attached to this posting
The "TIFF Header Format" is easy:
Offset 00h, 2 Byte = Byte Order, "II"=intel, "MM"=motorola. (I = 0x49)
Offset 02h, 2 Byte = Version Nr.
Offset 04h, 4 Byte = pointer to first IFD entry
Description of TIFF header: https://www.awaresystems.be/imaging/tiff/faq.html#q3
Howto read and analyse the binary content correctly? This is my messy, not operational code:
$sampleTiff="H:\daten\tif\11\11\111111.TIF" $h=FileOpen($sampleTiff,16) $content=FileRead($h) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $content = ' & $content & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console FileClose($h) $type=VarGetType($content) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $type = ' & $type & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $ToString=BinaryToString($content) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ToString = ' & $ToString & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite(@CRLF & @CRLF) $content=StringTrimLeft($content,2) ; cut off the leading "0x" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $content = ' & $content & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console for $i = 1 to 8 step 8 $next=StringMid($content,$i,2) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $next = ' & $next & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $Chr=BinaryToString($next) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Chr = ' & $Chr & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite(@CRLF & "---" & @CRLF) Next Regards, Rudi.
Afternoon, I could very well be doing this wrong so feel free to totally advise otherwise - I'm wanting to use a GUI to first display a key from within an INI file, then secondly change the INI file by using a FileSelectFolder command but then I want to see the GUI change to reflect the change I've just made.
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Input1 = GUICtrlCreateInput(Iniread(@WorkingDir & "\test.ini","Path","FilePath",""), 64, 80, 121, 21) $Button1 = GUICtrlCreateButton("Change", 200, 80, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $selectedFolder = FileSelectFolder("Select Log Path Directory",@WorkingDir,0) If NOT $selectedFolder = "" Then $newLogPath = IniWrite(@WorkingDir & "\test.ini","Path","FilePath",$selectedFolder) EndIf EndSwitch WEnd So 2 part question really: (1) Should I be using GUICtrlCreateInput to display my INI read from within the GUI? (2) How can I refresh the GUI to update that to read the new information I've just written to the GUI?