@leef_me, that is awesome

ok, i've made a lot of progress!
this is what i now have:
#IfWinActive ahk_class Chrome_WidgetWin_1
RAlt & 0:: ;Right Alt + 0 (that's a zero)
clipboard = ; Empty the clipboard
Send, ^a^c
ClipWait, 2
if ErrorLevel
{
keep1 := "Empty"
}
keep1 := clipboard
clipboard = ; Empty the clipboard
Send, {tab}^c
ClipWait, 2
if ErrorLevel
{
keep2 := "Empty 2"
}
keep2 := clipboard
clipboard = ; Empty the clipboard
Send, {tab}^c
ClipWait, 2
if ErrorLevel
{
keep3 := "Empty 3"
}
keep3 := clipboard
clipboard = ; Empty the clipboard
Send, {tab}^c
ClipWait, 2
if ErrorLevel
{
keep4 := "Empty 4"
}
keep4 := clipboard
clipboard = ; Empty the clipboard
Send, {tab}^c
ClipWait, 2
if ErrorLevel
{
keep5 := "Empty 5"
}
keep5 := clipboard
clipboard = ; Empty the clipboard
Send, {tab}^c
ClipWait, 2
if ErrorLevel
{
keep6 := "Empty 6"
}
keep6 := clipboard
MsgBox Control-C copied the following contents to the clipboard:`n`n keep1: %keep1% `n`n keep2: %keep2% `n`n keep3: %keep3% `n`n keep4: %keep4% `n`n keep5: %keep5% `n`n keep6: %keep6%
Return
a few questions:
1. Why doesn't it work without: #IfWinActive ahk_class Chrome_WidgetWin_1
If I leave this out, then it doesn't work
How do I make it so that it works ANYWHERE! (I need to use on different browsers)
ahk_class Chrome_WidgetWin_1 is a problem. I started Autolt Window Spy and got from the ahk_class Chrome_WidgetWin_0 as being the window. This worked for a while, but then stopped working, When I ran Window Spy again, this time I got ahk_class Chrome_WidgetWin_1
What am I missing?
2. How long should I clipwait?
I used 2 - the amount they used in the example code
3. When do I use comma? I tried googling but can't find an explanation
4. What does a newline mean? If I have this in my code, does it mean anything?
Is it ok to space my code out? What happens if I have empty lines - does this effect the code?
For example, what if I had:
MsgBox Control-C
copied the following contents to
the clipboard:
`n`n keep1: %keep1% `n`n
keep2: %keep2% `n`n keep3:
%keep3% `n`n keep4: %keep4% `n`n keep5: %keep5% `n`n keep6:
%keep6%
5 .If i have an empty field, I get a 'PING' sound (loud annoying ping sound!)
Is there anyway round this?
i.e. I have this code:
clipboard = ; Empty the clipboard
Send, {tab}^c
ClipWait, 2
if ErrorLevel
{
keep6 := "Empty 6"
}If there is text to copy, then is OK
If not, I get the annoying PING sound!
6. I have keep6 := "Empty 6" - this doesn't work. Instead, I just get keep6 to be nothing when I send to the messagebox
What am I doing wrong?
7. Is there a different way to paste stored text?
Instead of:
clipboard := keep1
Send, ^v
Isn't there a paste command that pastes your variables?
8. I've now tried to do the other part of the code I need - pasting into another form in another browser
I have:
#IfWinActive ahk_class MozillaWindowClass
RAlt & 9:: ;Right Alt + 9
Send, ^a
clipboard := keep1
Send, ^v
Send, {tab}
clipboard := keep2
Send, ^v
Send, {tab}
clipboard := keep3
Send, ^v
Send, {tab}
clipboard := keep4
Send, ^v
Send, {tab}
clipboard := keep6
Send, ^v
Send, {tab}
Erm... this just doesn't work!
It manages to do a few Ctrl+Tab keys for some reason
Where am I going wrong?
Thanks!!
OM