Jump to content

aurm

Members
  • Posts

    18
  • Joined

  • Last visited

aurm's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Now I believe the problem is in clipput() and clipget() or how I use them , is there any problem that sets the text in clipboard to an empty string ? if I use Send() and send the statement as an input it works fine instead of clipput() then send("^v") any idea ? UPDATE : hope this is the end of the problem , I found another way to set/get data from clipboard , functions : _ClipBoard_SetData () & _ClipBoard_GetData() , after trying them it worked well will come later isA to assure whether its finally correct or not
  2. PhoenixXL thnx for the reply , about the ' Mod 50 ' thing : first I intended to make a program that holds large amounts of data to be pasted instead of only one text item , so I made the array of size 50 to hold amounts of data as big as possible , and once the user has exceeded the 50-items conditions the program shall overwrite the data from the beginning , for example when counter reachs 51 , then 51 % 50 = 1 , so it would overwrite the first element of the array About the error , after several copies and pastes , I found that the program didn't copy some text , instead it saved empty strings ,and for debugging I used MsgBox to show me the value of array[index] after each copy operations and it resulted in- many times - empty strings I read your code you referred to above , but for the honesty I didn't understand some parts of it ; as I am very new to Autoit , and I hope I would find the bug in my code since its driving me crazy
  3. that's interesting , have a look at this thread : I think it would interest you
  4. here is the new addToClipboard() , which didn't work too but I believe this is the more correct than the previous one , since it handles the duration of pressing the keys Func addToClipboard() HotKeySet("^+q") ; This unregisters the key from this function , in case the keys were pressed for a long time While _IsPressed("11") Or _IsPressed("10") Or _IsPressed("51"); Wait until the ctrl and the Shift and the Q keys are unpressed Sleep(50) WEnd Send ("^c") $copied = ClipGet() $clipBoard[Mod($counter,50)] = $copied $counter +=1 HotKeySet("^+q","addToClipboard") EndFunc hopefully someone would help find the bug
  5. http://stackoverflow.com/questions/10505664/autoit-hotkeyset-not-working/10506053#10506053 didn't try it yet , but would help anyone who encountered the same problem
  6. np could it be related to the windows platform ? since I'm using 64-bit version ? but I still don't see any dependency on the windows platform that might cause this problem
  7. @jerrif , thanks for the reply , but I think that the problem isn't in emptyAll() , when I tried to display a messagebox with the value of copied statement the result was an empty window which is weird to me, and the problem described didn't include an emptyAll action , I just copy and paste without getting to the emptyAll() part
  8. Hi everyone , I'm trying to make some kind of simple clipboard controller , where the user could have several items copied to the clipboard when using a hotkey (Ctrl+Shift+Q) , instead of only one item when using Ctrl+C , and would be able to paste them all at once (Ctrl+Shift+W) , or paste any of the first 10 items directly (Ctrl+Shift+1...9), another option is to clear the clipboard (Ctrl+Shift+'-'). The problem is that it works fine until I paste once and try to copy again : nothing is added to the clipboard. I'm trying to figure it out , but couldn't find a reason for this.. here is the code : #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <array.au3> Global $clipBoard[50]=[""] Global $counter = 0 HotKeySet("^+q","addToClipboard") HotKeySet("^+-","emptyAll") HotKeySet("^+w","getAll") HotKeySet("^+1","get1") HotKeySet("^+2","get2") HotKeySet("^+3","get3") HotKeySet("^+4","get4") HotKeySet("^+5","get5") HotKeySet("^+6","get6") HotKeySet("^+7","get7") HotKeySet("^+8","get8") HotKeySet("^+9","get9") $hGUI = GuiCreate("Clipboard Controller", 100, 100,Default,Default,$WS_SIZEBOX) GUISetState() Func addToClipboard() Send ("^c") $copied = ClipGet() $clipBoard[Mod($counter,50)] = $copied $counter +=1 EndFunc Func getByIndex($i) $statement = $clipBoard[$i] ClipPut($statement) Send("^v") EndFunc Func getAll() $statement ="" For $i In $clipBoard If $i <> "" Then $statement &= $i & @CRLF EndIf Next ClipPut($statement) Send("^v") EndFunc Func emptyAll() For $i=0 To 49 $clipBoard[$i]="" Next ClipPut("") EndFunc Func get1() getByIndex(0) EndFunc Func get2() getByIndex(1) EndFunc Func get3() getByIndex(2) EndFunc Func get4() getByIndex(3) EndFunc Func get5() getByIndex(4) EndFunc Func get6() getByIndex(5) EndFunc Func get7() getByIndex(6) EndFunc Func get8() getByIndex(7) EndFunc Func get9() getByIndex(8) EndFunc While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd any ideas/help ?
  9. I'm having a problem when trying to set hotkeys with numbers , i.e : "^w{1}" which resembles a Ctrl+W+1 , but it doesn't work for me , when I reach the letter 'W' the function registered with the hotkey is called , without waiting for the last digit '1' , any idea ?
  10. I didn't like to make a new thread , since the topic is the same good job PhoenixXL , and sorry for interrupting with a question . I'm trying to set a hotkey Ctrl+W+1 , for some reason it doesn't work for me , just when I get to the letter 'W' it calls the function registered with the hotkey , so I'm having troubles with trying to make several hotkeys that differ only in the last digit. Any help ? Note : I tried using "^w{NUMPAD 0}" , "^w1" and both didn't work
  11. Hi Melba I tried the script below and it worked well , the weird thing is that It didn't work for the labels , and to confuse me more : when I changed the last parameter (label size) to "400" instead of "200" it worked fine ! so I guess I will work with the 400 till I know where I made things wrong
  12. @realm your reply was really good , in fact I liked it for being to the point so , I'm trying to make a simple clipboard manager , that doesn't limit the clipboard to only one entry. i.e : instead of overwriting the data in the buffer when pressing Ctrl+C , all the copied data shall be collected ; so that the user could paste a group of data at one time , instead of multiple copies and pastes . so this is the part of the code where things aren't going well , the checkboxes and the labels issue was solved , now a new problem Func gettext () Send ("^c") $copied = ClipGet() $arr[$counter] = $copied GUICtrlCreateCheckbox("",20,50+($height),25,25) $aSize = _StringSize($copied, Default, Default, Default, "",200) GUICtrlCreateLabel($aSize[0], 40, 50+$height, $aSize[2], $aSize[3]) $height+=20 $counter+=1 EndFunc the main problem is that the text isn't displayed well using the labels , so I used a UDF developed by Melba -"#include "StringSize.au3" - to format the text , which works pretty well but fails and generates an error if the text contained CRLFs . i.e : copying a block of code results in : Subscript used with non-Array variable.: GUICtrlCreateLabel($aSize[0], 40, 50+$height, $aSize[2], $aSize[3]) GUICtrlCreateLabel($aSize^ ERROR sometimes it works well and most of the time generates the error mentioned above . so any idea why is it failing although $asize is an array ?
  13. yup , as u said exactly
  14. that's really a nice job , I didn't think I would get all these stumbles in my second day of scripting with autoIt , I'm having a problem of formatting the labels , it was partially solved when I used your UDF , but still get an error : UICtrlCreateLabel($aSize[0], 40, 50+$height, $aSize[2], $aSize[3]) GUICtrlCreateLabel($aSize^ ERROR the problem occurs when I try to create a label with the text resulting from clipget() , it results only when the clipget() has text with CRLF i.e: trying to Ctrl+C 2 lines of code , and creating a label with that value results in the error written above
  15. I'm having a java app that responds to certain Hotkeys/strokes, but the java's app window should have the focus ; so that it receives/listens to the keystrokes , so I wanted to set the hotkeys through autoIt , and just send the strokes to the java app where all the logic goes on
×
×
  • Create New...