Jump to content

user52

Active Members
  • Posts

    61
  • Joined

  • Last visited

user52's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. #include <String.au3> $str = _ 'this.' & _ 'is.a.' & _ 'strin' & _ 'g' ConsoleWrite(chunk_split($str, 5) & @CRLF) ConsoleWrite('============================================================================' & @CRLF) $str = _ 'this.is.the.start.of' & _ '.some.string.that.sh' & _ 'ould.be.split.into.c' & _ 'hunks' & _ '' ConsoleWrite(chunk_split($str, 20) & @CRLF) Func chunk_split($body, $chunklen = 76, $end = @CRLF) $len = StringLen($body) $chunks = Ceiling($len / $chunklen) $end_len = StringLen($end) $newbody = $body $ends = 0 For $i = $chunklen To $len Step $chunklen $pos = ($chunklen * $ends) + ($end_len * $ends) + $chunklen $newbody = _StringInsert($newbody, $end, $pos) $ends += 1 Next Return $newbody EndFunc ;==>chunk_split #cs this. is.a. strin g ============================================================================ this.is.the.start.of .some.string.that.sh ould.be.split.into.c hunks #ce
  2. # \Program Files\AutoIt3\SciTE\SciTEConfig\scite-config.SciTEConfig #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # START: DO NOT CHANGE ANYTHING AFTER THIS LINE #-#-#-#-# # Dark SciTE4AutoIt3 Color scheme #------------------------------------------------------------ font.base=font:Arial,size:10,$(font.override) font.monospace=font:Courier New,size:10 proper.case=0 check.updates.scite4autoit3=1 use.tabs=1 indent.size=4 indent.size.*.au3=4 tabsize=4 #Background style.au3.32=style.*.32=$(font.base),back:#F0F4F9 #CaretLineBackground caret.line.back=#FFFED8 # Brace highlight style.au3.34=fore:#0000FF,bold,back:#F0F4F9 # Brace incomplete highlight style.au3.35=fore:#009933,italics,back:#F0F4F9 #White space style.au3.0=fore:#000000,back:#F0F4F9 #Comment line style.au3.1=fore:#009933,italics,back:#F0F4F9 #Comment block style.au3.2=fore:#669900,italics,back:#F0F4F9 #Number style.au3.3=fore:#AC00A9,italics,bold,back:#F0F4F9 #Function style.au3.4=fore:#000090,italics,bold,back:#F0F4F9 #Keyword style.au3.5=fore:#0000FF,bold,back:#F0F4F9 #Macro style.au3.6=fore:#FF33FF,bold,back:#F0F4F9 #String style.au3.7=fore:#9999CC,bold,back:#F0F4F9 #Operator style.au3.8=fore:#FF0000,bold,back:#F0F4F9 #Variable style.au3.9=fore:#AA0000,bold,back:#F0F4F9 #Sent keys style.au3.10=fore:#FF8800,bold,back:#F0F4F9 #Pre-Processor style.au3.11=fore:#F000FF,italics,back:#F0F4F9 #Special style.au3.12=fore:#A00FF0,italics,back:#F0F4F9 #Abbrev-Expand style.au3.13=fore:#FF0000,bold,back:#F0F4F9 #Com Objects style.au3.14=fore:#0000FF,italics,bold,back:#F0F4F9 #Standard UDF's style.au3.15=fore:#0080FF,italics,bold,back:#F0F4F9 # END => DO NOT CHANGE ANYTHING BEFORE THIS LINE #-#-#-#-#-# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  3. Jos, I do agree and I can see not replacing SciTE.exe, SciLexer.dll for AutoIt users. My intention was to have a setup where one could simply extract the zip and run SciTE without installing AutoIt and the SciTE4AutoIt3. As for the properties files, there are colors defined in there, see for example perl.properties It sounds like I'm going to need to separate this for AutoIt users. Which files should I not replace for AutoIt users? Thanks
  4. Thanks Damian. I've added Install (http://code.google.com/p/scite-config/#Install): 1. Download http://code.google.com/p/scite-config/downloads/list 2. Extract to C:\Program Files\AutoIt3\SciTE\ 3. Run C:\Program Files\AutoIt3\SciTE\SciTE.exe Download http://code.google.com/p/scite-config/downloads/list Edit: download link
  5. UPDATE: The original instructions didn't include the exact colors from the screen shots. 1. Download scite-config from http://code.google.com/p/scite-config/downloads/list 2. Extract to C:\Program Files\AutoIt3\SciTE\ 3. Run C:\Program Files\AutoIt3\SciTE\SciTE.exe 4. Optional: Open %USERPROFILE%\SciTEUser.properties (same as selecting Options> Open User Options File in SciTE). Replace text with the included SciTEUser.properties to match colors in screen shots --- This is a dark theme for SciTE. Use: http://code.google.com/p/scite-config/ Screenshot:
  6. wow this is old. thanks formatted: #include-once Demo() ; ------------------------------------------------------------------------------ ; ; AutoIt Version: 3.0 ; Language: English ; Description: Functions that assist with Windows Folder Options. ; ; ------------------------------------------------------------------------------ ;=============================================================================== ; ; Description: Query or set Windows option to Show/Hide file extensions ; Syntax: _ShowHideFileExt( $iParm ) ; Parameter(s): $iParm - the action you want the function to perform ; -1 = query. Return the current setting for extensions. ; 0 = show. Assure extensions are showing, set if necessary. ; 1 = hide. Assure extensions are hiding, set if necessary. ; Requirement(s): None ; Return Value(s): On Success - returns the current setting (0=Show 1=Hide) ; On Failure - returns -1 and sets @error = 1 ; if there is an error reading the registry ; or if a bad parameter is passed. ; Author(s): Lilla Renfro Slater <lilla@earthlink.net> ; Notes: For all versions of windows. Tested under Windows XP and 98. ; Under Windows XP, "Hide extensions for known files" option (default = enabled) ; is located on Control Panel > Folder Options > View tab. ; ; This function is helpful when using AutoIt Windows Matching with applications ; that show the file name on the title bar, such as: Notepad, Word, Excel, etc. ; ; For example, ; eula - Notepad (window title when extensions are set to hide) ; eula.txt - Notepad (window title when extensions are set to show) ; ; Example 1: This code assures that extensions are showing. ; _ShowHideFileExt(0) ; run('notepad.exe c:\windows\system32\eula.txt') ; WinWaitActive('eula.txt - Notepad') ; ; Example 2: This code adapts to the existing Show/Hide File Ext. setting ; $result = _ShowHideFileExt(-1) ; return the current setting ; run('notepad.exe c:\windows\system32\eula.txt') ; If $result = 0 Then ;extensions are showing ; $ext='.txt' ; Else ;extensions are hidden ; $ext='' ; EndIf ; WinWaitActive('eula' & $ext & ' - Notepad') ; ; Example 3: This code assures that extensions are showing, and ; restores the initial setting when done. ; Dim $query = -1, $show =0 , $hide = 1 ; $initial = _ShowHideFileExt($query) ; If $initial <> $show then ; $flag=1 ; _ShowHideFileExt($show) ; EndIf ; run('notepad.exe c:\windows\system32\eula.txt') ; WinWaitActive('eula.txt - Notepad') ; msgbox(0,'debug',"observe that Notepad's title line INCLUDES file extension") ; WinClose('eula.txt - Notepad') ; If $flag=1 then _ShowHideFileExt($initial) ;restore initial setting ; ;=============================================================================== Func _ShowHideFileExt($iParm) Local $key, $ret, $query = -1, $show = 0, $hide = 1 $key = RegRead( 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'HideFileExt' ) If @error Then $ret = -1 SetError( 1 ) Else Select Case $iParm = $show If $key = $hide Then ;hide => show RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", 0) ;EnvUpdate() - doesn't appear to make a difference EndIf $ret = $show Case $iParm = $hide If $key = $show Then ;show => hide RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", 1) ;EnvUpdate() - doesn't appear to make a difference EndIf $ret = $hide Case $iParm = $query $ret = $key Case Else $ret = -1 SetError( 1 ) EndSelect EndIf Return $ret EndFunc ;==>_ShowHideFileExt Func Demo() ; toggle hide/show file extensions Local $query = -1, $show = 0, $hide = 1 For $i = 1 To 2 $initial = _ShowHideFileExt ($query) ;toggle setting for demo purposes If $initial = 1 Then $flag = 1 $now = _ShowHideFileExt (0) ElseIf $initial = 0 Then $flag = 1 $now = _ShowHideFileExt (1) EndIf Run('notepad.exe c:\windows\system32\eula.txt') If $now = 1 Then WinWaitActive('eula - Notepad') MsgBox(0, @scriptname, "observe that Notepad's title line does NOT include file extension") WinClose('eula - Notepad') ElseIf $now = 0 Then WinWaitActive('eula.txt - Notepad') MsgBox(0, @scriptname, "observe that Notepad's title line INCLUDES file extension") WinClose('eula.txt - Notepad') EndIf Next EndFunc ;==>Demo
  7. can you translate this? thanks mysql_insert_id() http://forums.mysql.com/read.php?38,98672,98868#msg-98868 CODEAfter executing your Insert-Command (C#, Connection is stored in conDBConnection):... string strSQLSelect = "SELECT @@IDENTITY AS 'LastID'"; MySqlCommand dbcSelect = new MySqlCommand(strSQLSelect, conDBConnection); MySqlDataReader dbrSelect = dbcSelect.ExecuteReader(); dbrSelect.Read(); int intCounter = Int32.Parse(dbrSelect.GetValue(0).ToString()); dbrSelect.Dispose(); conDBConnection.Close(); MessageBox.Show("Test: " + intCounter.ToString()); "SELECT @@IDENTITY AS 'LastID'"
  8. any way to use mysql_insert_id()? mysql_insert_id(); http://www.php.net/mysql_insert_id $query = ""; $oconnectionobj.execute($query); thanks
  9. thanks letting me know about PDFTK.exe http://www.pdfhacks.com/pdftk/pdftk-1.12.exe.zip (i know this is an old post) i can now update meta data using update_info, which is really just creating a copy of the pdf you specify with the meta data you specify ;command line code ;reads a.pdf meta data and outputs out.pdf with meta data specified in in.info pdftk.exe a.pdf update_info in.info output out.pdf ; contents of in.info InfoKey: Title InfoValue: this is the NEW title InfoKey: Author InfoValue: this is the NEW author InfoKey: Keywords InfoValue: these are the NEW keywords InfoKey: Subject InfoValue: this is the NEW subject! C:\pdftk-1.12>pdftk.exe __ a.pdf ___ update_info _ in.info ________ output __________ out.pdf _____________ ^run pdftk _ ^pdf src_ ^command ____ ^new meta data _ ^output command _ ^pdf save name with in.info meta data dump_data Reads a single, input PDF file and reports vari- ous statistics, metadata, bookmarks (a/k/a out- lines), and page labels to the given output filename or (if no output is given) to stdout. Does not create a new PDF. dump_data_fields Reads a single, input PDF file and reports form field statistics to the given output filename or (if no output is given) to stdout. Does not create a new PDF. update_info <info data filename | - | PROMPT> Changes the metadata stored in a single PDF's Info dictionary to match the input data file. The input data file uses the same syntax as the output from dump_data. This does not change the metadata stored in the PDF's XMP stream, if it has one. For example:
  10. i've change it just a bit for what i needed. thanks ; toggle show/hide by clicking tray icon #include <Constants.au3> #include <GUIConstants.au3> Global $is_minimized = 0 Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "Toggle") $GUI = GUICreate("Minimize me", 460, 400) GUICtrlCreateLabel("Toggle show/hide by clicking tray icon", 125, 175) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE GuiSetState(@SW_HIDE) $is_minimized = 1 debug("$is_minimized: " & $is_minimized) EndSwitch WEnd Func Toggle() If $is_minimized = 1 Then GuiSetState(@SW_SHOW) $is_minimized = 0 Else GuiSetState(@SW_HIDE) $is_minimized = 1 EndIf debug("$is_minimized: " & $is_minimized) EndFunc Func debug($a) ConsoleWrite(@SEC & " " & $a & @CRLF) EndFunc
  11. so... the solution to post #6 and #12 was what? was it...? $oQuery = _IEFormElementGetObjByName($oForm, "input_name_here") _IEAction($oQuery, "focus") Send("date_goes_here")oÝ÷ Ù©Ýjëh×6$oQuery = _IEFormElementGetObjByName($oForm, "submit_button") _IEAction($oQuery, "focus") Send("{Enter}")
  12. i thought this was possible, cool
  13. -hidden from taskbar -always on top -no tray icon -minimal desktop real estate ;~ HotKeySet("{ESC}", "_Exit") #NoTrayIcon #include <GUIConstants.au3> $w = 196 $h = 17 $Parent = GUICreate("") $gui = GUICreate("", $w, $h, (@DesktopWidth - $w - 3) / 2, @DesktopHeight - $h - 28 - 1, $WS_POPUP, $WS_EX_TOPMOST, $Parent) GUISetBkColor(0xffffff) GUISetFont(10, 400, 0, "arial") $date = GUICtrlCreateLabel("", 3, 1, 500, 500) GUICtrlSetColor(-1, 0x000000) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GuiSetState() Update() Func Update() While 1 $h = @HOUR $m = @MIN If $h > 12 Then $h = $h - 12 $m = $m & " PM" Else If $h = 12 Then $m = $m & " PM" Else $m = $m & " AM" EndIf EndIf GUICtrlSetData($date, GetDayOfWeek() & ", " & GetMonth() & " " & @MDAY & ", " & @YEAR & " " & $h & ":" & $m) Sleep(500) GUICtrlSetData($date, GetDayOfWeek() & ", " & GetMonth() & " " & @MDAY & ", " & @YEAR & " " & $h & " " & $m) Sleep(500) WEnd EndFunc Func _Exit() Exit EndFunc Func GetDayOfWeek() $a = @WDAY If $a = 1 Then Return "Sunday" If $a = 2 Then Return "Monday" If $a = 3 Then Return "Tuesday" If $a = 4 Then Return "Wednesday" If $a = 5 Then Return "Thursday" If $a = 6 Then Return "Friday" If $a = 7 Then Return "Saturday" EndFunc Func GetMonth() $a = @MON If $a = 1 Then Return "January" If $a = 2 Then Return "February" If $a = 3 Then Return "March" If $a = 4 Then Return "April" If $a = 5 Then Return "May" If $a = 6 Then Return "June" If $a = 7 Then Return "July" If $a = 8 Then Return "August" If $a = 9 Then Return "September" If $a = 10 Then Return "October" If $a = 11 Then Return "November" If $a = 12 Then Return "December" EndFunc
  14. SOLVED!! the page uses inputs as combo dropdowns. it turns out there were hidden inputs that javascript was changing when you selected an option from the dropdown. SOLUTION: simply change the value of the visible AND hidden inputs using _IEFormElementSetValue() and voila! it works!! the inputs: Index,Id,Name,Type,Value,Label,Size,Maximum Length,State 23,inpt_status5,inpt_status,text,In Progress,,,, 24,hddn_status5,status,hidden,2,,,, 25,indx_status5,hidden,2,,,,,
×
×
  • Create New...