
Clear
Members-
Posts
7 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Clear's Achievements

Seeker (1/7)
1
Reputation
-
FrancescoDiMuro reacted to a post in a topic: GUICtrlSetOnEvent - unset event
-
Hey Guys. In GUICtrlSetOnEvent help page we can read: It seems, it doesn't work in 3.3.14.5 or am I doing something wrong? ; unbound code(...) GUICtrlCreateGroup("Hotkeys settings", 10, 220, 580, 90) GUICtrlSetFont(-1, 8.5, 400) GUICtrlCreateLabel("Number of registered Hotkeys:", 20, 240) $idNumHotkeys = GUICtrlCreateLabel(UBound($g_aHotkeys), 400, 240) GUICtrlCreateLabel("HotKeys:", 20, 270) Local $aHots[UBound($g_aHotkeys)] For $i = 0 To UBound($g_aHotkeys) -1 $aHots[$i] = $g_aHotkeys[$i][0] Next $idHotkeys = GUICtrlCreateCombo("", 160, 270, 270, 0, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, _ArrayToString($aHots)) ; $idHotkeyDelete = GUICtrlCreateButton("", 450, 268, 30, 30, 0x0040) GUICtrlSetImage(-1, $g_sFilePath & "icon-delete.ico") GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetTip(-1, "----------" & @CRLF & "Remove selected Hotkey", "REMOVE") $idHotkeySuspend = GUICtrlCreateButton("", 480, 268, 30, 30, 0x0040) GUICtrlSetImage(-1, $g_sFilePath & "icon-pause.ico") GUICtrlSetState(-1, $GUI_DISABLE) ; GUICtrlSetFont(-1, 12, 800, 0, "Segoe UI Symbol") GUICtrlSetTip(-1, "-----------" & @CRLF & "Pause selected Hotkey until the next script reload", "SUSPEND") $idHotkeyEdit = GUICtrlCreateButton("", 510, 268, 30, 30, 0x0040) GUICtrlSetImage(-1, $g_sFilePath & "icon-edit.ico") GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetTip(-1, "-----------" & @CRLF & "Edit Selected Hotkey", "EDIT") $idHotkeyAdd = GUICtrlCreateButton("", 540, 268, 30, 30, 0x0040) GUICtrlSetImage(-1,$g_sFilePath & "icon-add4.ico") GUICtrlSetTip(-1, "-----------" & @CRLF & "Opens GUI for creating new Hotkey", "ADD NEW Hotkey") ; Unbound Code (...) GUICtrlSetOnEvent($idHotkeys, "enableButtons") ; Unbound Code (...) Func enableButtons() $i = @GUI_CtrlId GUICtrlSetOnEvent($i, "") $i+=1 While BitAnd(GUICtrlGetState($i), $GUI_DISABLE) GUICtrlSetState($i, $GUI_ENABLE) $i += 1 WEnd EndFunc It can be bypassed by something like: ; Unbound code (...) GUICtrlSetOnEvent($i, "Blank") ; Unbound code (...) Func Blank() ; Do Nothing EndFunc But I wonder: Have I understood help incorrectly and it is about something else (then about what?) Did I do something wrong? It's something that was planned but not yet implemented (such as Maps) It's just a mistake in help file In case 3 or 4 is correct, it would be good to remove that information from Help File, because it may be confusing
-
Hey, In 3.3.14.5 help file, there is information about Maps (associative arrays), but this type is not working. When I read about it, I was really happy, because it was something that could really make my life easier. Unfortunately, quickly I was awaken with errors of badly formatted subscripts. I started to check in my code for errors and when didn't find any, I googled it. So now, I know it's only beta function (post from March) - but is in Help File of retail version. Also, if I checked properly, It was given in 2015 for beta. Do AutoIt team plan to add Maps to retail version or there are bugs of this functionality that makes it impossible for near future? Cheers,
-
Thanks It works almost perfectly (formatted text is retrieved as plain, but it's still very good)
-
Clear reacted to a post in a topic: Clipboard save and retrieve
-
hey, guys, Thanks for your help. Unfortunately, I didn't want to copy image from file to clipboard, but rather to save and retrieve clipboard content - whichever it is - to retrieve it after template is send. User uses hotkey to activate gui User click button on gui to send corresponding template Program saves current clipboard content into memory (it can be anything - because, at the time, you don't know what user will be holding in clipboard) Program sets clipboard to template content (text) Program sends keystroke CTRL + V to send template Program retrieves clipboard content that was saved in 3. point I have found this thread with user created function _Clipboard_GetAll() and it seems kinda good for now. Sometimes, unfortunately the Clipboard is not retrieved during test, but it may be because I am testing it too fast. Will try to check it slower to check if it work properly. The current $Text function is: Func Text($Text) ; Remove saved Clip Content in case it was not removed by any chance before $Clip = "" Local $Timer = TimerInit() While TimerDiff($Timer) < 1000 _ClipBoard_Open(0) ; Copy current clipboard content by using wraithdu script _Clipboard_GetAll($Clip) _ClipBoard_Close() If $Clip Then ExitLoop Sleep(10) EndIf WEnd ; copying template content to clipboard ClipPut($Text) ; sending clipboard to other application Send("^v") ; releasing clipboard content _Clipboard_Open(0) _Clipboard_Empty() _Clipboard_Close() ; retrievieng clipboard content _ClipBoard_PutAll($Clip) $Clip = "" EndFunc EDIT: Unfortunately, it crashes or failing at random
-
It seems like _Clipboard_GetData, _Clipboard_SetData and ...Ex functions are not working with $iFormat set to $CF_BITMAP in my workstation (Windows 10 64-bit) or I am doing it in wrong way. So something which I could acomplish with just few lines in AutoHotkey doesn't seem to work at all with AutoIt or I don't know how Once again, I will write what I am trying to do: Creating simple script that will bind hotkeys for quickly writing written templates (it's ok) #include <GUIConstantsEx.au3> #include <Clipboard.au3> HotKeySet("^{NUMPAD1}", TemplatesGreeting) HotKeySet("^{NUMPAD2}", TemplatesFarewell) HotkeySet("^{NUMPAD3}", TemplatesVerification) Opt("SendKeyDelay", 0) While 1 Sleep(100) WEnd While entering hotkey, GUI with templates' categories' buttons will appear. Clicking buttons should send templates. Func TemplatesFarewell() Local $GUI1 = GUICreate("Farewell GUI", 275, 400) GUICtrlCreateLabel("Choose radio button", 10, 10) Local $FormRadio1 = GUICtrlCreateRadio("R1", 10, 40) Local $FormRadio2 = GUICtrlCreateRadio("R_2", 60, 40) GUICtrlCreateLabel("Choose Template to use:", 10, 100) Local $Button1 = GUICtrlCreateButton("Template #1", 10, 125, 250, 25) Local $Button2 = GUICtrlCreateButton("Template #2", 10, 160, 250, 25) Local $Button3 = GUICtrlCreateButton("Template #3", 10, 195, 250, 25) GUISetState(@SW_SHOW) ; HERE STARTS PROBLEM Local $FirstText = "Bye :)" While 1 Switch GUIGetMsg() Case $FormRadio1 $FirstText = "Bye :)" Case $FormRadio2 $FirstText = "Goodbye :)" Case $Button1 ; By using Send GUIDelete($GUI1) Send($FirstText & @CRLF & "Thanks for nothing! Here I will add some local chars like ąćęóńżź") ; Problem - it's slow. Otherwise, works fine Case $Button2 ; By using ControlSend GUIDelete($GUI1) ControlSend("Active Conversations", "", "", $FirstText & ". Thanks for anything - Some local chars like ąćęóńźż") ; It seems it works faster, but Polish chars are not displayed :( That's why I need to use something else ; The program to send is SunAwtFrame class (Jp2Launcher - Java) Case $Button3 ; By Using SendText (Clipboard) GUIDelete($GUI1) SendText($FirstText & ". This is some text. Blebleble." & @CRLF & "Have a nice day") Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($GUI1) EndFunc Func SendText($Text) ; User can have something in Clipboard - we store it to retrieve it later to make sure nothing is lost. Local $Clip = _ClipBoard_GetData($CF_BITMAP) ; Once we have saved clipboard content, we change clipboard to our template and send it ClipPut($Text) Send("^v") ; Now it's time to retrieve our clipboard from memory _ClipBoard_SetData($Clip, $CF_BITMAP) EndFunc EDIT: I am really sorry. I didn't notice till now, my previous post was written not in English. I edited it
-
Próbowałem, ale po wybraniu tej opcji, w ogóle nie działa, chyba że coś źle robię. Nie działa wtedy ani dla tekstu, ani obrazków, ani niczego innego. W przypadku obrazków, przy próbie wklejenia, pojawia się komunikat (do innych programów oczywiście tez nie działa) I tried, but after choosing this option, it doesn't work at all or I'm not doing it properly. It doesn't work for text, nor images, neither anything else. In case of images, when trying to paste, there is error: Kod: Func Text($Text) Local $Clip = _ClipBoard_GetData($CF_BITMAP) ClipPut($Text) Send("^v") _ClipBoard_SetData($Clip, $CF_BITMAP) EndFunc
-
Hey, First, I am really sorry for this question. I have searched for the answer for several minutes, in Help File and via Google, but can't answer it by myself. I am new to AutoIt. Before I have used AutoHotkey for simple improvements of my work station. Unfortunately, IT decided to update OS to Windows 10, and with that, AutoHotkey was removed and instead AutoIt has been given. Unfortunately, I need to learn syntax, and as for me, it's more weird syntax for simple tasks (however I must admit, GUI is easier). What is my problem is that Send and ControlSend commands are not as effective as in case of SendInput. I want to create some templates with hotkeys and gui. Unfortunately, Send is too slow for bigger templates (text is pasted in SunAwtFrame class (program created in Java) with no ControlId. That's why I wanted to use Clipboard to make it work faster. In AutoHotkey it would be something like: ClipCopy := ClipboardAll Clipboard = Template to send Send, ^v Clipboard := ClipCopy ClipCopy = Unfortunately, something similar doesn't work in AutoIt: Local $ClipCopy = _Clipboard_GetData() ClipPut("Template to Send") Send("^v") _Clipboard_SetData($ClipCopy) It works only for text. I know that's because it need additional parameter for storing other type of content, but how am i supposed to know, what will be stored in clipboard? Is there any other way to achieve what I am trying to do?