 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
AdamPash Guest
|
|
| Back to top |
|
 |
Elevator_Hazard
Joined: 28 Oct 2006 Posts: 303 Location: Illinois
|
Posted: Sat Mar 03, 2007 4:29 am Post subject: |
|
|
I haven't tried it out, but it looks good, I really like all the effort you put into showing people how to use it and what it's uses are. I wish I were that determined for www.freewebtown.com/elevator_hazard but oh well.
Um could possibly use the Control, EditPaste command instead of Send because if someone wanted to do maybe #5 blah blah blah to send, it would send Win+5 and some other stuff, but maybe it won't... Test it with things like + and # and ^. To use editpaste, just look it up in the helpfile, you will need to use something to get the current window's focus when replacing though. _________________ Changed siggy at request of ahklerner  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Mar 03, 2007 1:17 pm Post subject: |
|
|
Your presentation is great, especially the videos.
I notice you're using the Input command to implement your own hotstring/replacement engine. Perhaps one of your reasons for doing so is AutoHotkey's inability to dynamically create hotstrings (i.e. while the script is running). If you found any other limitations that made using built-in hotstrings difficult or impossible, please let me know.
A tiny cosmetic improvement to your code: I notice you sometimes escape braces as `{ and `}. This isn't necessary except in the Send command, in which case you would use {{} and {}} (or use SendRaw to avoid the need for escaping).
Great work on Texter, especially its intuitive interface! |
|
| Back to top |
|
 |
AdamPash Guest
|
Posted: Sun Mar 04, 2007 2:28 am Post subject: |
|
|
@Elevator_Hazard: My script doesn't suffer from that problem b/c in Text mode, I'm sending the clipboard contents. In script mode, I actually *want* to be able to send special characters like ^ as Ctrl and # and Windows key. See the documentation for more.
@Chris: Thanks a lot, that's really nice to hear! Like you said, I couldn't use AHK's built-in hotstring function b/c I can't build them on the fly. That's the main reason I didn't even start off trying to use AHK's hotstrings.
I am seeing one major problem, though, and that's re:issues with Windows clipboard incompatibilites. I haven't been able to narrow down the causes entirely (sometimes it looks to be caused by clipboard helpers), but in some XP and Vista installations Send,^v will send what was previously in the clipboard rather than what I used AHK to put into the clipboard:
| Code: | EXECUTE:
SoundPlay, %A_ScriptDir%\resources\replace.wav
oldClip = %Clipboard%
ReturnTo := 0
StringLen,BSlength,input
Send {BS %BSlength%}
FileRead, Clipboard, %A_WorkingDir%\replacements\%input%.txt
IfInString,Clipboard,::scr:: {
StringReplace,Script,Clipboard,::scr::,,
Send,%Script%
oldClip = %Clipboard% ; this is to make sure that if someone scripts a copy, it is retained
return
}
else {
IfInString,Clipboard,`%c {
StringReplace, Clipboard, Clipboard, `%c, %oldClip%, All
}
IfInString,Clipboard,`%| {
StringGetPos,CursorPoint,Clipboard,`%|
StringReplace, MeasureClip,Clipboard,`n,,All
StringGetPos,CursorPoint,MeasureClip,`%|
StringReplace, Clipboard, Clipboard, `%|,, All
StringReplace, MeasureClip,Clipboard,`n,,All
StringLen,ClipLength,MeasureClip
ReturnTo := ClipLength - CursorPoint
}
Send,^v
if ReturnTo > 0
Send {Left %ReturnTo%}
Clipboard = %oldClip%
} |
So I assign new value to the clipboard here:
| Code: | | FileRead, Clipboard, %A_WorkingDir%\replacements\%input%.txt |
...and paste it with Send,^v. But it still sends the old clipboard. Can you shed any light on what's going on here? |
|
| Back to top |
|
 |
Elevator_Hazard
Joined: 28 Oct 2006 Posts: 303 Location: Illinois
|
Posted: Sun Mar 04, 2007 2:42 am Post subject: |
|
|
I really don't know... But maybe using Clipboard as an outputvar doesn't work... Just maybe, not sure though. _________________ Changed siggy at request of ahklerner  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Mar 04, 2007 2:50 pm Post subject: |
|
|
I tried the following simple test and it works okay:
| Code: | FileRead, Clipboard, %A_ScriptFullPath%
Send ^v | It's possible that some PCs have a clipboard manager installed that interferes with the script's attempts to change the clipboard. Or maybe it's a timing problem of some kind (in which case putting a Sleep somewhere might fix it). |
|
| Back to top |
|
 |
pepoluan_notlogin Guest
|
Posted: Mon Mar 05, 2007 8:45 pm Post subject: Clipboard problems |
|
|
Deep inside the following thread: http://www.autohotkey.com/forum/topic5807.html is a discussion on how Clipboard may be too slow.
Try using a ClipboardWait as one of the post suggested. |
|
| Back to top |
|
 |
AdamPash Guest
|
Posted: Tue Mar 06, 2007 8:34 am Post subject: |
|
|
| Interesting - but I can't for the life of me find any documentation on ClipboardWait. Am I missing something? |
|
| Back to top |
|
 |
BETLOG
Joined: 27 Nov 2006 Posts: 218 Location: Queensland, Australia
|
|
| Back to top |
|
 |
pepoluan
Joined: 12 Jun 2006 Posts: 18 Location: Jakarta, Indonesia
|
Posted: Wed Mar 07, 2007 7:36 pm Post subject: |
|
|
Ooops  |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3615 Location: Belgrade
|
Posted: Wed Mar 07, 2007 7:54 pm Post subject: |
|
|
Very nice script and interface  _________________
 |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 86
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|