Leaderboard
Popular Content
Showing content with the highest reputation on 09/18/2015 in all areas
-
SSD - Set Sound Device Current Version: v4 (2017-Sep-15) Windows XP allows you to output sound to more than one audio device... Vista and newer Windows versions do not. To overcome this "Failure by Design", (IMHO somehow related to DRM, preventing user to make digital copies of analog sources), I have coded SSD - Set Sound Device. SSD enables you to change the default Sound Device by shortcut or command line. It works fine on my Win10-1703 64bit machine. If you find bugs please let me know. The source and executable can be downloaded from my site: http://www.funk.eu Kudos to Ascend4nt and NerdFencer for parts of the code, and Yashied for his most excellent WinAPIEx UDF. Enjoy ...1 point
-
I took the long way here but have arrived. I am trying to replicate map functions as I hunt for the most enjoyable way to play with INI style data (which is why the func names are all _map*). This is by no means complete but it is a working demo. As always feel free to improve this, and then post that. UDF ;_MapInit ;_MapAddKeyValuePair ;_MapReassignKey ;_MapAppendToKey ;_MapRemoveKey ;_MapGetValue ;_MapToString ;_MapToArray ;_MapTo2dArray ;_MapFrom2DArray ;_MapToIniSection ;_MapFromIniSection Func _MapInit() Local $map = ObjCreate("Scripting.Dictionary") If Not IsObj($map) Then Exit MsgBox(0, "Error", "Object not created") EndIf return $map EndFunc ;_MapInit Func _MapAddKeyValuePair($map , $key , $value) If $map.Exists($key) Then msgbox(0, 'Error' , '"' & $key & '"' & ' already exists with a value of ' & '"' & $map.Item($key) & '"') Else $map.Add($key, $value) EndIf EndFunc ;_MapAddKeyValuePair Func _MapReassignKey($map , $key , $value) If $map.Exists($key) Then $map.remove($key) $map.Add($key, $value) Else $map.Add($key, $value) EndIf EndFunc ;_MapReassignKey Func _MapAppendToKey($map , $key , $value) If $map.Exists($key) Then $sCurrent = $map.Item($key) $map.remove($key) $map.Add($key, $sCurrent & ";" & $value) Else $map.Add($key, $value) EndIf EndFunc ;_MapAppendToKey Func _MapRemoveKey($map , $key) $map.remove($key) EndFunc ;_MapRemoveKey Func _MapGetValue($map , $key) return $map.Item($key) EndFunc ;_MapGetValue Func _MapToString($map) local $sOut = "" for $key in $map.Keys $sOut &= $key & " = " & $map.Item($key) & @LF Next return stringreplace($sOut , @LF , "" , -1) EndFunc ;_MapToString Func _MapToArray($map) local $aArray[$map.count] $i = 0 for $key in $map.Keys $aArray[$i] = $key & " = " & $map.Item($key) $i += 1 Next return $aArray EndFunc ;_MapToArray Func _MapTo2dArray($map) local $aArray[$map.count][2] $i = 0 for $key in $map.Keys $aArray[$i][0] = $key $aArray[$i][1] = $map.Item($key) $i += 1 Next return $aArray EndFunc ;_MapTo2dArray Func _MapToIniSection($map , $section , $filepath , $fSort = 0) $aMap = _MapTo2dArray($map) _ArrayInsert($aMap , 0 , ubound($aMap) - 1) If $fSort = 1 Then _ArraySort($aMap) IniWriteSection($filepath , $section , $aMap) EndFunc ;MapToIniSection Func _MapFromIniSection($filepath , $section) $map = _MapInit() $aArray = IniReadSection($filepath , $section) for $i = 1 to ubound($aArray) - 1 $map.add($aArray[$i][0] , $aArray[$i][1]) Next return $map EndFunc Func _MapFrom2DArray($2Darray) Local $map = ObjCreate("Scripting.Dictionary") If Not IsObj($map) Then Exit MsgBox(0, "Error", "Object not created") EndIf for $i = 0 to ubound($2Darray) - 1 _MapAddKeyValuePair($map , $2Darray[$i][0] , $2Darray[$i][1]) Next return $map EndFunc ;_MapToArray Example: #include 'dictmap.au3' #include<array.au3> ;map initialize - MUST BE FIRST $myDictionary = _MapInit() ;map add key/value pairs _MapAddKeyValuePair($myDictionary , "KeyEntry0" , "ValueEntry0") ; adding key/value pairs _MapAddKeyValuePair($myDictionary , "KeyEntry1" , "ValueEntry1") _MapAddKeyValuePair($myDictionary , "KeyEntry2" , "ValueEntry2") _MapAddKeyValuePair($myDictionary , "KeyEntry3" , "ValueEntry3") _MapAddKeyValuePair($myDictionary , "KeyEntry4" , "ValueEntry4") _MapAddKeyValuePair($myDictionary , "KeyEntry5" , "ValueEntry5") ;map get value of key msgbox(0, "Value of KeyEntry1" , _MapGetValue($myDictionary , "KeyEntry1")) ;see single value ;map add duplicate failure _MapAddKeyValuePair($myDictionary , "KeyEntry1" , "ValueEntry1_replaced") ;duplicate test ;map reassign key _MapReassignKey($myDictionary , "KeyEntry1" , "ValueEntry1_replaced") ;Key exists so Reassign the value msgbox(0, "Value of reassigned KeyEntry1" , _MapGetValue($myDictionary , "KeyEntry1")) ;see changed entry ;map append to key _MapAppendToKey($myDictionary , "KeyEntry4" , "ValueEntry4_append") ; append stuff to keyentry4 ;map remove key _MapRemoveKey($myDictionary , "KeyEntry0") ; remove key 0 ;map to string msgbox(0, 'Map String - No Sort' , _MapToString($myDictionary)) ;entire Map To string ;map to array $aMyDictionary = _MapToArray($myDictionary) ;Entire Map To Array _ArraySort($aMyDictionary) _ArrayDisplay($aMyDictionary , "1D Sorted") ;Map to 2D array $a2DmyDictionary = _MapTo2dArray($myDictionary) ;Entire Map To 2D Array _ArraySort($a2DmyDictionary) _ArrayDisplay($a2DmyDictionary , "2D Sorted") ;map from array $MapFrom2D = _MapFrom2DArray($a2DmyDictionary) for $key in $MapFrom2D.keys msgbox(0, 'MapFromArray' , $key & @LF & $MapFrom2D.item($key)) Next ;map to ini _MapToIniSection($myDictionary , "TEST_SECTION_01_Unsorted" , @ScriptDir & "\TEST_SECTION.ini") ;unsorted _MapToIniSection($myDictionary , "TEST_SECTION_02_Sorted" , @ScriptDir & "\TEST_SECTION.ini" , 1) ;sorted ShellExecute(@ScriptDir & "\TEST_SECTION.ini") ;map from ini $MapFromIni = _MapFromIniSection( @ScriptDir & "\TEST_SECTION.ini" , "TEST_SECTION_01_Unsorted") $aMapFromIni = _MapToArray($MapFromIni) ;Entire Map To Array _ArraySort($aMapFromIni) _ArrayDisplay($aMapFromIni , "from INI")1 point
-
Duplicate cursor/Double Cursor
Guilherme Tocchetto reacted to ViciousXUSMC for a topic
Your best option if possible is to find a way to do the automation without the mouse cursor. But with most automation running where its actually manipulating windows and such it may be hard to use the computer at the same time. The second idea is to have the mouse changes happen very quickly so that they do not really interrupt what your doing. Save your current mouse position to a variable, call your move/click and then recall your mouse position with fast movement options. An example in something I was messing with the other day that had to click on the title bar of Putty. ;Press Control+Alt+p to get Current Putty Screen Text HotKeySet("^!p", "PuttyScreen") While 1 Sleep(10) WEnd Func PuttyScreen() $aOldMouse = MouseGetPos() $vOldClip = ClipGet() WinActivate("[REGEXPTITLE:PuTTY.*]", "") $aPos = WinGetPos("[REGEXPTITLE:PuTTY.*]", "") MouseClick("left", $aPos[0]+15, $aPos[1]+15, 1, 1) Send("{DOWN 13}{Enter}") $vClip = ClipGet() ClipPut($vOldClip) MouseMove($aOldMouse[0], $aOldMouse[1], 1) MsgBox(0, "", "Current PuTTY Window:" & @CRLF & @CRLF & $vClip) EndFunc1 point -
Silent convert to avi
ahmeddzcom reacted to ViciousXUSMC for a topic
This is hardly an autoit issue unless you have it working in the cmd prompt first. I know from past use that you will not get an .AVI video file with that code. Honestly if that is your full script you may as well use a .bat file. This is where you need to go: https://ffmpeg.org/ffmpeg.html and http://club.myce.com/f62/ffmpeg-command-line-options-166608/ Once you have the right syntax to get the desired results, then we can easily help you make a autoit script.1 point -
Silent convert to avi
ahmeddzcom reacted to water for a topic
@SW_HIDE has to be parameter 5 but in your script it is parameter 4.1 point -
Duplicate cursor/Double Cursor
Guilherme Tocchetto reacted to Damein for a topic
I don't think that is possible but someone may know something I don't. As for it using the cursor to do the tasks, are you sure that it needs to? If I may ask what is the cursor doing, I presume clicking things? Most applications you can use ControlSend or ControlClick even to achieve this.1 point -
It changes an expression containing the usual wildcards $sExclude = "val*remove*|val*delete ?"to a pattern to be used in a regex $sExclude = "val.*?remove.*?|val.*?delete ."Let' say, it's a matter of style1 point
-
Then you have to set the focus after pressing the button as I suggested above.1 point
-
does the exe support command line switches? example: aaa.exe /q the /q is quiet and may launch the exe in invisible mode. You can test by using the /? switch to see if it supports any command line switches.1 point
-
sHarma, You post on an open forum - anyone can read your posts, you have no control over the audience. Although given you attitude towards him, I doubt jfish wishes to have anything more to do with you in any case. And speaking of attitude, for a second time I do not like the tone you are taking - remember that you are the one who started this thread and so far all I have seen are people trying to help, without a great deal of information from you. If you really do want help I suggest that you turn over a new leaf at once. M231 point
-
pppoe Keeps disconnecting
jvanegmond reacted to Jos for a topic
Fast ethernet card with an rj45 connector...right, not coax, so what device does your coax cable go into which comes from the cable supplier? i know it is/was quite common that a cable provider used pppoe to connect a device to its service, and ypu get an ip address ones that tunnel is build. There has to be a device that the coax cable plugs into first though and converts the signal to 10/100 ethernet untwisted pair. jos1 point -
This could work too : #Include <Array.au3> $sExclude = "val*remove*|val*delete ?" Local $aArray = ["value to keep 1", "value to keep 2", "value to keep 3", "value to remove 1", "value to remove 2", "value to keep 4", "value to delete 1"] $sExclude = StringReplace($sExclude, ".", "\.") $sExclude = StringReplace($sExclude, "?", ".") $sExclude = StringReplace($sExclude, "*", ".*?") $iIndex = 0 For $i = 0 To UBound($aArray) - 1 If NOT StringRegExp($aArray[$i], $sExclude) Then $aArray[$iIndex] = $aArray[$i] $iIndex += 1 EndIf Next Redim $aArray[$iIndex] _ArrayDisplay($aArray)1 point
-
HaveAnEfficientLookInTheHelpFile() ?1 point
-
Conrad, You can do it this way. You must download AutoItObject UDF. Parent.au3: #include <Array.au3> #include "AutoItObject.au3" MsgBox( 0, "Parent", "This is parent" ) _AutoItObject_StartUp() ; Register object to transfer data Global $sDataTransferObject = "DataTransferObject" Global $oDataTransferClass, $oDataTransferObject, $hDataTransferObject $oDataTransferClass = _AutoItObject_Class() $oDataTransferClass.AddProperty( "ArrayData" ) $oDataTransferObject = $oDataTransferClass.Object $hDataTransferObject = _AutoItObject_RegisterObject( $oDataTransferObject, $sDataTransferObject ) ; Create array Global $aArray[1000][10] For $i = 0 To 1000 - 1 For $j = 0 To 9 $aArray[$i][$j] = $i & "/" & $j Next Next _ArrayDisplay( $aArray, "Array on parent" ) ; Transfer data $oDataTransferObject.ArrayData = $aArray ; Start child ShellExecuteWait( "Child.au3" ) ; ------- Parent waiting while child is executing ------- MsgBox( 0, "Parent", "This is parent again" ) ; Receive data on parent $aArray = $oDataTransferObject.ArrayData _ArrayDisplay( $aArray, "Modified array on parent" ) ; Unregister data transfer object _AutoItObject_UnregisterObject( $hDataTransferObject ) _AutoItObject_Shutdown() Exit Child.au3: #include <Array.au3> MsgBox( 0, "Child", "This is child" ) ; Data transfer object Global $sDataTransferObject = "DataTransferObject" Global $oDataTransferObject = ObjGet( $sDataTransferObject ) ; Receive data on child Global $aArray = $oDataTransferObject.ArrayData _ArrayDisplay( $aArray, "Array on child" ) ; Modify array on child For $i = 0 To 100 - 1 $aArray[$i][0] = "Modified" $aArray[$i][1] = "on" $aArray[$i][2] = "child" Next _ArrayDisplay( $aArray, "Modified array on child" ) ; Transfer data $oDataTransferObject.ArrayData = $aArray Exit1 point
-
FileMove And iF File Exists Rename
ahmeddzcom reacted to DXRW4E for a topic
The thing is very complicated because of the file extension (that sometimes does not exist) etc etc, the safe way is _FileExistsEx '?do=embed' frameborder='0' data-embedContent>> ; #FUNCTION# ==================================================================================================================== ; Name...........: _FileExistsEx ; Description ...: Get New Files Name ; Syntax.........: _FileExistsEx(ByRef $sFilePath[, $iFileExists]) ; Parameters ....: $sFilePath - The Fullpath file ; $iFileExists - Optional ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _FileExistsEx(ByRef $sFilePath, $iFileExists = 0) While FileExists($sFilePath) $iFileExists += 1 $sFilePath = StringRegExpReplace($sFilePath & " ", "( - \(\d+\))?(\.[^\.\\]*)?(\h)$", " - (" & $iFileExists & ")$2") WEnd EndFunc Local $sFilePath = @DesktopDir & "\FileName1.xxx" _FileExistsEx($sFilePath) ;if the file exists - $sFilePath = @DesktopDir & "\FileName1 (1).xxx" _FileExistsEx($sFilePath, 7) ;if the file exists - $sFilePath = @DesktopDir & "\FileName1 (8).xxx" Ciao.1 point