To match in all windows except one with a certain title is a little
trickier
as regexes do not provide a straight-forward way of doing so.
However, the
following should work:
^((?!.*VirtualBox OSE).)*$
The above assumes that the window title ends on VirtualBox OSE. Any
window
titles that end on this will NOT trigger a match, and any that don't,
will.
I tried this but it is not working for me. (I'm using autokey 0.81.4)
First of all, in normal python console,
>>> re.search('^((?!.*VirtualBox OSE).)*$', 'asrtas VirtualBox OSE trsietnsri')
Does not give me any match. So it seems the regex is not matching the
string even though it does not end with VirtualBox OSE.
Anyway, at least it is excluding any string with VirtualBox OSE, so I
tried to set it in my window filter, but whatever window name I try it
did not work.
> To match in all windows except one with a certain title is a little
> trickier
> as regexes do not provide a straight-forward way of doing so.
> However, the
> following should work:
> ^((?!.*VirtualBox OSE).)*$
> The above assumes that the window title ends on VirtualBox OSE. Any
> window
> titles that end on this will NOT trigger a match, and any that don't,
> will.
> I tried this but it is not working for me. (I'm using autokey 0.81.4)
> First of all, in normal python console,
> >>> re.search('^((?!.*VirtualBox OSE).)*$', 'asrtas VirtualBox OSE trsietnsri')
> Does not give me any match. So it seems the regex is not matching the
> string even though it does not end with VirtualBox OSE.
> Anyway, at least it is excluding any string with VirtualBox OSE, so I
> tried to set it in my window filter, but whatever window name I try it
> did not work.
On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com> wrote: > Joon,
> Try taking all the regex stuff out and using simple wildcards, which > work for me. Try *VirtualBox*.
> - Al
> On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote: >> Hi,
>> One of the discussions Chris said:
>> To match in all windows except one with a certain title is a little >> trickier >> as regexes do not provide a straight-forward way of doing so. >> However, the >> following should work:
>> ^((?!.*VirtualBox OSE).)*$
>> The above assumes that the window title ends on VirtualBox OSE. Any >> window >> titles that end on this will NOT trigger a match, and any that don't, >> will.
>> I tried this but it is not working for me. (I'm using autokey 0.81.4)
>> First of all, in normal python console,
>> >>> re.search('^((?!.*VirtualBox OSE).)*$', 'asrtas VirtualBox OSE >> trsietnsri')
>> Does not give me any match. So it seems the regex is not matching the >> string even though it does not end with VirtualBox OSE.
>> Anyway, at least it is excluding any string with VirtualBox OSE, so I >> tried to set it in my window filter, but whatever window name I try it >> did not work.
Oh, sorry about that. Can you give us a list of window titles that are
open at the time when you are expecting this filter work correctly?
Give us both a list of window titles that match and do not match
according to what you think is supposed to happening based on that
pattern. Maybe we can help you further with that kind of data.
Thanks,
Al
On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:
> Thanks for the reply. The thing is I am trying to exclude some windows,
> not include.
> -Joon
> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com> wrote:
> > Joon,
> > Try taking all the regex stuff out and using simple wildcards, which
> > work for me. Try *VirtualBox*.
> > - Al
> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote:
> >> Hi,
> >> One of the discussions Chris said:
> >> To match in all windows except one with a certain title is a little
> >> trickier
> >> as regexes do not provide a straight-forward way of doing so.
> >> However, the
> >> following should work:
> >> ^((?!.*VirtualBox OSE).)*$
> >> The above assumes that the window title ends on VirtualBox OSE. Any
> >> window
> >> titles that end on this will NOT trigger a match, and any that don't,
> >> will.
> >> I tried this but it is not working for me. (I'm using autokey 0.81.4)
> >> Does not give me any match. So it seems the regex is not matching the
> >> string even though it does not end with VirtualBox OSE.
> >> Anyway, at least it is excluding any string with VirtualBox OSE, so I
> >> tried to set it in my window filter, but whatever window name I try it
> >> did not work.
Ok, so I looked at the re.search information at python to understand
that filter better, then I made one of my own but for gedit windows.
And it worked great, I could successfully cause my macro to not run in
windows matching that portion of the title but run in others. So what
version of Ubuntu, python and autokey are you running?
-Al
On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:
> Thanks for the reply. The thing is I am trying to exclude some windows,
> not include.
> -Joon
> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com> wrote:
> > Joon,
> > Try taking all the regex stuff out and using simple wildcards, which
> > work for me. Try *VirtualBox*.
> > - Al
> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote:
> >> Hi,
> >> One of the discussions Chris said:
> >> To match in all windows except one with a certain title is a little
> >> trickier
> >> as regexes do not provide a straight-forward way of doing so.
> >> However, the
> >> following should work:
> >> ^((?!.*VirtualBox OSE).)*$
> >> The above assumes that the window title ends on VirtualBox OSE. Any
> >> window
> >> titles that end on this will NOT trigger a match, and any that don't,
> >> will.
> >> I tried this but it is not working for me. (I'm using autokey 0.81.4)
> >> Does not give me any match. So it seems the regex is not matching the
> >> string even though it does not end with VirtualBox OSE.
> >> Anyway, at least it is excluding any string with VirtualBox OSE, so I
> >> tried to set it in my window filter, but whatever window name I try it
> >> did not work.
Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The system python version is 2.7.2. Can you please show me what did you use to exclude gedit? Maybe I can try your regex.
On Wed, 18 Jan 2012 20:38:24 -0600, Al <itscoolrea...@gmail.com> wrote: > Joon,
> Ok, so I looked at the re.search information at python to understand > that filter better, then I made one of my own but for gedit windows. > And it worked great, I could successfully cause my macro to not run in > windows matching that portion of the title but run in others. So what > version of Ubuntu, python and autokey are you running?
> -Al
> On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote: >> Hi Al,
>> Thanks for the reply. The thing is I am trying to exclude some windows, >> not include.
>> -Joon
>> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com> wrote: >> > Joon,
>> > Try taking all the regex stuff out and using simple wildcards, which >> > work for me. Try *VirtualBox*.
>> > - Al
>> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote: >> >> Hi,
>> >> One of the discussions Chris said:
>> >> To match in all windows except one with a certain title is a little >> >> trickier >> >> as regexes do not provide a straight-forward way of doing so. >> >> However, the >> >> following should work:
>> >> ^((?!.*VirtualBox OSE).)*$
>> >> The above assumes that the window title ends on VirtualBox OSE. Any >> >> window >> >> titles that end on this will NOT trigger a match, and any that >> don't, >> >> will.
>> >> I tried this but it is not working for me. (I'm using autokey 0.81.4)
>> >> Does not give me any match. So it seems the regex is not matching the >> >> string even though it does not end with VirtualBox OSE.
>> >> Anyway, at least it is excluding any string with VirtualBox OSE, so I >> >> tried to set it in my window filter, but whatever window name I try >> it >> >> did not work.
Ironically, I replaced all of your text for "Virtualbox OSE" with
"gedit". I then made sure I have several apps open that would respond
to my macro including a gedit window. It was the gedit window that
didn't react to the macro, not until i changed the regex enough to
make it the match mechanism not recognize the gedit window. So, I
performed no real magic here. However, I can think of one thing, if
your window title text is not matching entirely, ie, does it end in
OSE or is it ending in OSE and a letter? I ask because the last '.'
means match one character. I want you try leaving off that last '.'
and seeing what happens. In the meantime i'm installing virtualbox-ose
to see if i duplicate your problem.
- al
On Jan 18, 9:58 pm, "Joon Ro" <joonp...@gmail.com> wrote:
> Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The system
> python version is 2.7.2.
> Can you please show me what did you use to exclude gedit? Maybe I can try
> your regex.
> -Joon
> On Wed, 18 Jan 2012 20:38:24 -0600, Al <itscoolrea...@gmail.com> wrote:
> > Joon,
> > Ok, so I looked at the re.search information at python to understand
> > that filter better, then I made one of my own but for gedit windows.
> > And it worked great, I could successfully cause my macro to not run in
> > windows matching that portion of the title but run in others. So what
> > version of Ubuntu, python and autokey are you running?
> > -Al
> > On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:
> >> Hi Al,
> >> Thanks for the reply. The thing is I am trying to exclude some windows,
> >> not include.
> >> -Joon
> >> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com> wrote:
> >> > Joon,
> >> > Try taking all the regex stuff out and using simple wildcards, which
> >> > work for me. Try *VirtualBox*.
> >> > - Al
> >> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote:
> >> >> Hi,
> >> >> One of the discussions Chris said:
> >> >> To match in all windows except one with a certain title is a little
> >> >> trickier
> >> >> as regexes do not provide a straight-forward way of doing so.
> >> >> However, the
> >> >> following should work:
> >> >> ^((?!.*VirtualBox OSE).)*$
> >> >> The above assumes that the window title ends on VirtualBox OSE. Any
> >> >> window
> >> >> titles that end on this will NOT trigger a match, and any that
> >> don't,
> >> >> will.
> >> >> I tried this but it is not working for me. (I'm using autokey 0.81.4)
> >> >> Does not give me any match. So it seems the regex is not matching the
> >> >> string even though it does not end with VirtualBox OSE.
> >> >> Anyway, at least it is excluding any string with VirtualBox OSE, so I
> >> >> tried to set it in my window filter, but whatever window name I try
> >> it
> >> >> did not work.
> >> >> Could you please give me some help on this?
Thank you very much for your help. I just tried gedit as well and gedit case it seems to be working for me as well. And please don't install Virtualbox OSE because that was the example chris was using, and I'm not having trouble with that.
Let me give you one of my example. I want to exclude the LyX window. My LyX window's title is
LyX: ~/workspace/newfile1.lyx
And whatever I try, I cannot make autokey to exclude this. For example,
On Thu, 19 Jan 2012 09:54:24 -0600, Al <itscoolrea...@gmail.com> wrote: > Hi Joon,
> Ironically, I replaced all of your text for "Virtualbox OSE" with > "gedit". I then made sure I have several apps open that would respond > to my macro including a gedit window. It was the gedit window that > didn't react to the macro, not until i changed the regex enough to > make it the match mechanism not recognize the gedit window. So, I > performed no real magic here. However, I can think of one thing, if > your window title text is not matching entirely, ie, does it end in > OSE or is it ending in OSE and a letter? I ask because the last '.' > means match one character. I want you try leaving off that last '.' > and seeing what happens. In the meantime i'm installing virtualbox-ose > to see if i duplicate your problem.
> - al
> On Jan 18, 9:58 pm, "Joon Ro" <joonp...@gmail.com> wrote: >> Hi Al,
>> Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The system >> python version is 2.7.2. >> Can you please show me what did you use to exclude gedit? Maybe I can >> try >> your regex.
>> -Joon
>> On Wed, 18 Jan 2012 20:38:24 -0600, Al <itscoolrea...@gmail.com> wrote: >> > Joon,
>> > Ok, so I looked at the re.search information at python to understand >> > that filter better, then I made one of my own but for gedit windows. >> > And it worked great, I could successfully cause my macro to not run in >> > windows matching that portion of the title but run in others. So what >> > version of Ubuntu, python and autokey are you running?
>> > -Al
>> > On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote: >> >> Hi Al,
>> >> Thanks for the reply. The thing is I am trying to exclude some >> windows, >> >> not include.
>> >> -Joon
>> >> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com> >> wrote: >> >> > Joon,
>> >> > Try taking all the regex stuff out and using simple wildcards, >> which >> >> > work for me. Try *VirtualBox*.
>> >> > - Al
>> >> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote: >> >> >> Hi,
>> >> >> One of the discussions Chris said:
>> >> >> To match in all windows except one with a certain title is a >> little >> >> >> trickier >> >> >> as regexes do not provide a straight-forward way of doing so. >> >> >> However, the >> >> >> following should work:
>> >> >> ^((?!.*VirtualBox OSE).)*$
>> >> >> The above assumes that the window title ends on VirtualBox OSE. >> Any >> >> >> window >> >> >> titles that end on this will NOT trigger a match, and any that >> >> don't, >> >> >> will.
>> >> >> I tried this but it is not working for me. (I'm using autokey >> 0.81.4)
>> >> >> Does not give me any match. So it seems the regex is not matching >> the >> >> >> string even though it does not end with VirtualBox OSE.
>> >> >> Anyway, at least it is excluding any string with VirtualBox OSE, >> so I >> >> >> tried to set it in my window filter, but whatever window name I >> try >> >> it >> >> >> did not work.
>> >> >> Could you please give me some help on this?
> Thank you very much for your help.
> I just tried gedit as well and gedit case it seems to be working for me as
> well.
> And please don't install Virtualbox OSE because that was the example chris
> was using,
> and I'm not having trouble with that.
> Let me give you one of my example. I want to exclude the LyX window.
> My LyX window's title is
> LyX: ~/workspace/newfile1.lyx
> And whatever I try, I cannot make autokey to exclude this.
> For example,
> ^((?!LyX.*).)*$
> does not work.
> -Joon
> On Thu, 19 Jan 2012 09:54:24 -0600, Al <itscoolrea...@gmail.com> wrote:
> > Hi Joon,
> > Ironically, I replaced all of your text for "Virtualbox OSE" with
> > "gedit". I then made sure I have several apps open that would respond
> > to my macro including a gedit window. It was the gedit window that
> > didn't react to the macro, not until i changed the regex enough to
> > make it the match mechanism not recognize the gedit window. So, I
> > performed no real magic here. However, I can think of one thing, if
> > your window title text is not matching entirely, ie, does it end in
> > OSE or is it ending in OSE and a letter? I ask because the last '.'
> > means match one character. I want you try leaving off that last '.'
> > and seeing what happens. In the meantime i'm installing virtualbox-ose
> > to see if i duplicate your problem.
> > - al
> > On Jan 18, 9:58 pm, "Joon Ro" <joonp...@gmail.com> wrote:
> >> Hi Al,
> >> Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The system
> >> python version is 2.7.2.
> >> Can you please show me what did you use to exclude gedit? Maybe I can
> >> try
> >> your regex.
> >> -Joon
> >> On Wed, 18 Jan 2012 20:38:24 -0600, Al <itscoolrea...@gmail.com> wrote:
> >> > Joon,
> >> > Ok, so I looked at the re.search information at python to understand
> >> > that filter better, then I made one of my own but for gedit windows.
> >> > And it worked great, I could successfully cause my macro to not run in
> >> > windows matching that portion of the title but run in others. So what
> >> > version of Ubuntu, python and autokey are you running?
> >> > -Al
> >> > On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:
> >> >> Hi Al,
> >> >> Thanks for the reply. The thing is I am trying to exclude some
> >> windows,
> >> >> not include.
> >> >> -Joon
> >> >> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com>
> >> wrote:
> >> >> > Joon,
> >> >> > Try taking all the regex stuff out and using simple wildcards,
> >> which
> >> >> > work for me. Try *VirtualBox*.
> >> >> > - Al
> >> >> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote:
> >> >> >> Hi,
> >> >> >> One of the discussions Chris said:
> >> >> >> To match in all windows except one with a certain title is a
> >> little
> >> >> >> trickier
> >> >> >> as regexes do not provide a straight-forward way of doing so.
> >> >> >> However, the
> >> >> >> following should work:
> >> >> >> ^((?!.*VirtualBox OSE).)*$
> >> >> >> The above assumes that the window title ends on VirtualBox OSE.
> >> Any
> >> >> >> window
> >> >> >> titles that end on this will NOT trigger a match, and any that
> >> >> don't,
> >> >> >> will.
> >> >> >> I tried this but it is not working for me. (I'm using autokey
> >> 0.81.4)
> >> >> >> First of all, in normal python console,
> >> >> >> Does not give me any match. So it seems the regex is not matching
> >> the
> >> >> >> string even though it does not end with VirtualBox OSE.
> >> >> >> Anyway, at least it is excluding any string with VirtualBox OSE,
> >> so I
> >> >> >> tried to set it in my window filter, but whatever window name I
> >> try
> >> >> it
> >> >> >> did not work.
> >> >> >> Could you please give me some help on this?
Sorry for the repeated postings. So it looks like you are doing this
from a terminal. So I opened my terminal and starting fiddling and lo
and behold, I couldn't get my terminal window to except either with
the filtering thing. But I did notice some interesting functions in
autokey like get_window_title() so I decided to use that plus some of
the more simpler re.search() capabilities of python. If you put the
following at the top of your script, I believe you will have no
problem excluding your LyX windows.
import re
t = window.get_active_title()
m = re.search("LyX", t)
if m==None:
# code to execute if 'LyX' is not in the title
# ...
# more code
# ...
# etc ...
else:
# code to execute if 'Lyx' IS IN the title
# ...
# more code
# ...
# etc ...
I know that is bit contrived up there, I did it just in case someone
doesn't entirely understand python and wanted to do the same thing.
Hopefully it'll help them. But using that code structure I was able to
exclude my terminal window which started as "alan@homefront" and
instead of 'LyX' and I had used 'alan' in line 3.
Enjoy,
Al
On Jan 19, 9:11 pm, "Joon Ro" <joonp...@gmail.com> wrote:
> Thank you very much for your help.
> I just tried gedit as well and gedit case it seems to be working for me as
> well.
> And please don't install Virtualbox OSE because that was the example chris
> was using,
> and I'm not having trouble with that.
> Let me give you one of my example. I want to exclude the LyX window.
> My LyX window's title is
> LyX: ~/workspace/newfile1.lyx
> And whatever I try, I cannot make autokey to exclude this.
> For example,
> ^((?!LyX.*).)*$
> does not work.
> -Joon
> On Thu, 19 Jan 2012 09:54:24 -0600, Al <itscoolrea...@gmail.com> wrote:
> > Hi Joon,
> > Ironically, I replaced all of your text for "Virtualbox OSE" with
> > "gedit". I then made sure I have several apps open that would respond
> > to my macro including a gedit window. It was the gedit window that
> > didn't react to the macro, not until i changed the regex enough to
> > make it the match mechanism not recognize the gedit window. So, I
> > performed no real magic here. However, I can think of one thing, if
> > your window title text is not matching entirely, ie, does it end in
> > OSE or is it ending in OSE and a letter? I ask because the last '.'
> > means match one character. I want you try leaving off that last '.'
> > and seeing what happens. In the meantime i'm installing virtualbox-ose
> > to see if i duplicate your problem.
> > - al
> > On Jan 18, 9:58 pm, "Joon Ro" <joonp...@gmail.com> wrote:
> >> Hi Al,
> >> Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The system
> >> python version is 2.7.2.
> >> Can you please show me what did you use to exclude gedit? Maybe I can
> >> try
> >> your regex.
> >> -Joon
> >> On Wed, 18 Jan 2012 20:38:24 -0600, Al <itscoolrea...@gmail.com> wrote:
> >> > Joon,
> >> > Ok, so I looked at the re.search information at python to understand
> >> > that filter better, then I made one of my own but for gedit windows.
> >> > And it worked great, I could successfully cause my macro to not run in
> >> > windows matching that portion of the title but run in others. So what
> >> > version of Ubuntu, python and autokey are you running?
> >> > -Al
> >> > On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:
> >> >> Hi Al,
> >> >> Thanks for the reply. The thing is I am trying to exclude some
> >> windows,
> >> >> not include.
> >> >> -Joon
> >> >> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com>
> >> wrote:
> >> >> > Joon,
> >> >> > Try taking all the regex stuff out and using simple wildcards,
> >> which
> >> >> > work for me. Try *VirtualBox*.
> >> >> > - Al
> >> >> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote:
> >> >> >> Hi,
> >> >> >> One of the discussions Chris said:
> >> >> >> To match in all windows except one with a certain title is a
> >> little
> >> >> >> trickier
> >> >> >> as regexes do not provide a straight-forward way of doing so.
> >> >> >> However, the
> >> >> >> following should work:
> >> >> >> ^((?!.*VirtualBox OSE).)*$
> >> >> >> The above assumes that the window title ends on VirtualBox OSE.
> >> Any
> >> >> >> window
> >> >> >> titles that end on this will NOT trigger a match, and any that
> >> >> don't,
> >> >> >> will.
> >> >> >> I tried this but it is not working for me. (I'm using autokey
> >> 0.81.4)
> >> >> >> First of all, in normal python console,
> >> >> >> Does not give me any match. So it seems the regex is not matching
> >> the
> >> >> >> string even though it does not end with VirtualBox OSE.
> >> >> >> Anyway, at least it is excluding any string with VirtualBox OSE,
> >> so I
> >> >> >> tried to set it in my window filter, but whatever window name I
> >> try
> >> >> it
> >> >> >> did not work.
> >> >> >> Could you please give me some help on this?
Thanks again for your reply. I tried the following:
title = window.get_active_title() if title.find('LyX:') == -1: keyboard.send_keys('test string')
with some abbreviation. I just used str.find() instead of importing re module. It seems to be working, but strangely within 2 or 3 tries, autokey freezes. I don't know what is going on, but when I run autokey from the terminal to see any messages, when autokey freezes, autokey types the 'test string' in the TERMINAL window instead of whatever window I had evoked the script.
Are you having any autokey freezing problem with the script?
On Fri, 20 Jan 2012 13:36:06 -0600, Al <itscoolrea...@gmail.com> wrote: > Joon,
> Sorry for the repeated postings. So it looks like you are doing this > from a terminal. So I opened my terminal and starting fiddling and lo > and behold, I couldn't get my terminal window to except either with > the filtering thing. But I did notice some interesting functions in > autokey like get_window_title() so I decided to use that plus some of > the more simpler re.search() capabilities of python. If you put the > following at the top of your script, I believe you will have no > problem excluding your LyX windows.
> import re > t = window.get_active_title() > m = re.search("LyX", t) > if m==None: > # code to execute if 'LyX' is not in the title > # ... > # more code > # ... > # etc ... > else: > # code to execute if 'Lyx' IS IN the title > # ... > # more code > # ... > # etc ...
> I know that is bit contrived up there, I did it just in case someone > doesn't entirely understand python and wanted to do the same thing. > Hopefully it'll help them. But using that code structure I was able to > exclude my terminal window which started as "alan@homefront" and > instead of 'LyX' and I had used 'alan' in line 3.
> Enjoy,
> Al
> On Jan 19, 9:11 pm, "Joon Ro" <joonp...@gmail.com> wrote: >> Hi Al,
>> Thank you very much for your help. >> I just tried gedit as well and gedit case it seems to be working for me >> as >> well. >> And please don't install Virtualbox OSE because that was the example >> chris >> was using, >> and I'm not having trouble with that.
>> Let me give you one of my example. I want to exclude the LyX window. >> My LyX window's title is
>> LyX: ~/workspace/newfile1.lyx
>> And whatever I try, I cannot make autokey to exclude this. >> For example,
>> ^((?!LyX.*).)*$
>> does not work.
>> -Joon
>> On Thu, 19 Jan 2012 09:54:24 -0600, Al <itscoolrea...@gmail.com> wrote: >> > Hi Joon,
>> > Ironically, I replaced all of your text for "Virtualbox OSE" with >> > "gedit". I then made sure I have several apps open that would respond >> > to my macro including a gedit window. It was the gedit window that >> > didn't react to the macro, not until i changed the regex enough to >> > make it the match mechanism not recognize the gedit window. So, I >> > performed no real magic here. However, I can think of one thing, if >> > your window title text is not matching entirely, ie, does it end in >> > OSE or is it ending in OSE and a letter? I ask because the last '.' >> > means match one character. I want you try leaving off that last '.' >> > and seeing what happens. In the meantime i'm installing virtualbox-ose >> > to see if i duplicate your problem.
>> > - al
>> > On Jan 18, 9:58 pm, "Joon Ro" <joonp...@gmail.com> wrote: >> >> Hi Al,
>> >> Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The >> system >> >> python version is 2.7.2. >> >> Can you please show me what did you use to exclude gedit? Maybe I can >> >> try >> >> your regex.
>> >> -Joon
>> >> On Wed, 18 Jan 2012 20:38:24 -0600, Al <itscoolrea...@gmail.com> >> wrote: >> >> > Joon,
>> >> > Ok, so I looked at the re.search information at python to >> understand >> >> > that filter better, then I made one of my own but for gedit >> windows. >> >> > And it worked great, I could successfully cause my macro to not >> run in >> >> > windows matching that portion of the title but run in others. So >> what >> >> > version of Ubuntu, python and autokey are you running?
>> >> > -Al
>> >> > On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote: >> >> >> Hi Al,
>> >> >> Thanks for the reply. The thing is I am trying to exclude some >> >> windows, >> >> >> not include.
>> >> >> -Joon
>> >> >> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com> >> >> wrote: >> >> >> > Joon,
>> >> >> > Try taking all the regex stuff out and using simple wildcards, >> >> which >> >> >> > work for me. Try *VirtualBox*.
>> >> >> > - Al
>> >> >> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote: >> >> >> >> Hi,
>> >> >> >> One of the discussions Chris said:
>> >> >> >> To match in all windows except one with a certain title is a >> >> little >> >> >> >> trickier >> >> >> >> as regexes do not provide a straight-forward way of doing so. >> >> >> >> However, the >> >> >> >> following should work:
>> >> >> >> ^((?!.*VirtualBox OSE).)*$
>> >> >> >> The above assumes that the window title ends on VirtualBox OSE. >> >> Any >> >> >> >> window >> >> >> >> titles that end on this will NOT trigger a match, and any that >> >> >> don't, >> >> >> >> will.
>> >> >> >> I tried this but it is not working for me. (I'm using autokey >> >> 0.81.4)
>> >> >> >> First of all, in normal python console,
>> >> >> >> Does not give me any match. So it seems the regex is not >> matching >> >> the >> >> >> >> string even though it does not end with VirtualBox OSE.
>> >> >> >> Anyway, at least it is excluding any string with VirtualBox >> OSE, >> >> so I >> >> >> >> tried to set it in my window filter, but whatever window name I >> >> try >> >> >> it >> >> >> >> did not work.
>> >> >> >> Could you please give me some help on this?
I had the behavioral problem back in the 0.7x version. But when I
upgraded it went away. The only prime difference between us now is the
distribution type. Let us see if we can evoke even more error messages
from autokey, make sure it is not running and from terminal do:
"autokey-gtk -l", this way a ton of verbose message will write to
console. Then open your "LyX" thing or TERMINAL that you were testing
in and see what you get. Hopefully you'll get an error traceback that
Chris can use to debug the system or that one of us can use to figure
out the exact nature of the problem you are having now.
Btw, I like how you reduced what I did there.
- Al
On Jan 22, 1:01 am, "Joon Ro" <joonp...@gmail.com> wrote:
> Thanks again for your reply. I tried the following:
> title = window.get_active_title()
> if title.find('LyX:') == -1:
> keyboard.send_keys('test string')
> with some abbreviation. I just used str.find() instead of importing re
> module.
> It seems to be working, but strangely within 2 or 3 tries, autokey freezes.
> I don't know what is going on, but when I run autokey from the terminal to
> see any messages,
> when autokey freezes, autokey types the 'test string' in the TERMINAL
> window instead of
> whatever window I had evoked the script.
> Are you having any autokey freezing problem with the script?
> -Joon
> On Fri, 20 Jan 2012 13:36:06 -0600, Al <itscoolrea...@gmail.com> wrote:
> > Joon,
> > Sorry for the repeated postings. So it looks like you are doing this
> > from a terminal. So I opened my terminal and starting fiddling and lo
> > and behold, I couldn't get my terminal window to except either with
> > the filtering thing. But I did notice some interesting functions in
> > autokey like get_window_title() so I decided to use that plus some of
> > the more simpler re.search() capabilities of python. If you put the
> > following at the top of your script, I believe you will have no
> > problem excluding your LyX windows.
> > import re
> > t = window.get_active_title()
> > m = re.search("LyX", t)
> > if m==None:
> > # code to execute if 'LyX' is not in the title
> > # ...
> > # more code
> > # ...
> > # etc ...
> > else:
> > # code to execute if 'Lyx' IS IN the title
> > # ...
> > # more code
> > # ...
> > # etc ...
> > I know that is bit contrived up there, I did it just in case someone
> > doesn't entirely understand python and wanted to do the same thing.
> > Hopefully it'll help them. But using that code structure I was able to
> > exclude my terminal window which started as "alan@homefront" and
> > instead of 'LyX' and I had used 'alan' in line 3.
> > Enjoy,
> > Al
> > On Jan 19, 9:11 pm, "Joon Ro" <joonp...@gmail.com> wrote:
> >> Hi Al,
> >> Thank you very much for your help.
> >> I just tried gedit as well and gedit case it seems to be working for me
> >> as
> >> well.
> >> And please don't install Virtualbox OSE because that was the example
> >> chris
> >> was using,
> >> and I'm not having trouble with that.
> >> Let me give you one of my example. I want to exclude the LyX window.
> >> My LyX window's title is
> >> LyX: ~/workspace/newfile1.lyx
> >> And whatever I try, I cannot make autokey to exclude this.
> >> For example,
> >> ^((?!LyX.*).)*$
> >> does not work.
> >> -Joon
> >> On Thu, 19 Jan 2012 09:54:24 -0600, Al <itscoolrea...@gmail.com> wrote:
> >> > Hi Joon,
> >> > Ironically, I replaced all of your text for "Virtualbox OSE" with
> >> > "gedit". I then made sure I have several apps open that would respond
> >> > to my macro including a gedit window. It was the gedit window that
> >> > didn't react to the macro, not until i changed the regex enough to
> >> > make it the match mechanism not recognize the gedit window. So, I
> >> > performed no real magic here. However, I can think of one thing, if
> >> > your window title text is not matching entirely, ie, does it end in
> >> > OSE or is it ending in OSE and a letter? I ask because the last '.'
> >> > means match one character. I want you try leaving off that last '.'
> >> > and seeing what happens. In the meantime i'm installing virtualbox-ose
> >> > to see if i duplicate your problem.
> >> > - al
> >> > On Jan 18, 9:58 pm, "Joon Ro" <joonp...@gmail.com> wrote:
> >> >> Hi Al,
> >> >> Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The
> >> system
> >> >> python version is 2.7.2.
> >> >> Can you please show me what did you use to exclude gedit? Maybe I can
> >> >> try
> >> >> your regex.
> >> >> -Joon
> >> >> On Wed, 18 Jan 2012 20:38:24 -0600, Al <itscoolrea...@gmail.com>
> >> wrote:
> >> >> > Joon,
> >> >> > Ok, so I looked at the re.search information at python to
> >> understand
> >> >> > that filter better, then I made one of my own but for gedit
> >> windows.
> >> >> > And it worked great, I could successfully cause my macro to not
> >> run in
> >> >> > windows matching that portion of the title but run in others. So
> >> what
> >> >> > version of Ubuntu, python and autokey are you running?
> >> >> > -Al
> >> >> > On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:
> >> >> >> Hi Al,
> >> >> >> Thanks for the reply. The thing is I am trying to exclude some
> >> >> windows,
> >> >> >> not include.
> >> >> >> -Joon
> >> >> >> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com>
> >> >> wrote:
> >> >> >> > Joon,
> >> >> >> > Try taking all the regex stuff out and using simple wildcards,
> >> >> which
> >> >> >> > work for me. Try *VirtualBox*.
> >> >> >> > - Al
> >> >> >> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote:
> >> >> >> >> Hi,
> >> >> >> >> One of the discussions Chris said:
> >> >> >> >> To match in all windows except one with a certain title is a
> >> >> little
> >> >> >> >> trickier
> >> >> >> >> as regexes do not provide a straight-forward way of doing so.
> >> >> >> >> However, the
> >> >> >> >> following should work:
> >> >> >> >> ^((?!.*VirtualBox OSE).)*$
> >> >> >> >> The above assumes that the window title ends on VirtualBox OSE.
> >> >> Any
> >> >> >> >> window
> >> >> >> >> titles that end on this will NOT trigger a match, and any that
> >> >> >> don't,
> >> >> >> >> will.
> >> >> >> >> I tried this but it is not working for me. (I'm using autokey
> >> >> 0.81.4)
> >> >> >> >> First of all, in normal python console,
> >> >> >> >> Does not give me any match. So it seems the regex is not
> >> matching
> >> >> the
> >> >> >> >> string even though it does not end with VirtualBox OSE.
> >> >> >> >> Anyway, at least it is excluding any string with VirtualBox
> >> OSE,
> >> >> so I
> >> >> >> >> tried to set it in my window filter, but whatever window name I
> >> >> try
> >> >> >> it
> >> >> >> >> did not work.
> >> >> >> >> Could you please give me some help on this?
Another idea. Can you make a live screen cast and upload it to youtube
and send that link here so we can see exactly what is going on
according to the way you described it. Or give us painful step by step
instruction as to how to achieve what you are experiencing now
according to how you just described it.
Thanks,
- Al
On Jan 22, 1:01 am, "Joon Ro" <joonp...@gmail.com> wrote:
> Thanks again for your reply. I tried the following:
> title = window.get_active_title()
> if title.find('LyX:') == -1:
> keyboard.send_keys('test string')
> with some abbreviation. I just used str.find() instead of importing re
> module.
> It seems to be working, but strangely within 2 or 3 tries, autokey freezes.
> I don't know what is going on, but when I run autokey from the terminal to
> see any messages,
> when autokey freezes, autokey types the 'test string' in the TERMINAL
> window instead of
> whatever window I had evoked the script.
> Are you having any autokey freezing problem with the script?
> -Joon
> On Fri, 20 Jan 2012 13:36:06 -0600, Al <itscoolrea...@gmail.com> wrote:
> > Joon,
> > Sorry for the repeated postings. So it looks like you are doing this
> > from a terminal. So I opened my terminal and starting fiddling and lo
> > and behold, I couldn't get my terminal window to except either with
> > the filtering thing. But I did notice some interesting functions in
> > autokey like get_window_title() so I decided to use that plus some of
> > the more simpler re.search() capabilities of python. If you put the
> > following at the top of your script, I believe you will have no
> > problem excluding your LyX windows.
> > import re
> > t = window.get_active_title()
> > m = re.search("LyX", t)
> > if m==None:
> > # code to execute if 'LyX' is not in the title
> > # ...
> > # more code
> > # ...
> > # etc ...
> > else:
> > # code to execute if 'Lyx' IS IN the title
> > # ...
> > # more code
> > # ...
> > # etc ...
> > I know that is bit contrived up there, I did it just in case someone
> > doesn't entirely understand python and wanted to do the same thing.
> > Hopefully it'll help them. But using that code structure I was able to
> > exclude my terminal window which started as "alan@homefront" and
> > instead of 'LyX' and I had used 'alan' in line 3.
> > Enjoy,
> > Al
> > On Jan 19, 9:11 pm, "Joon Ro" <joonp...@gmail.com> wrote:
> >> Hi Al,
> >> Thank you very much for your help.
> >> I just tried gedit as well and gedit case it seems to be working for me
> >> as
> >> well.
> >> And please don't install Virtualbox OSE because that was the example
> >> chris
> >> was using,
> >> and I'm not having trouble with that.
> >> Let me give you one of my example. I want to exclude the LyX window.
> >> My LyX window's title is
> >> LyX: ~/workspace/newfile1.lyx
> >> And whatever I try, I cannot make autokey to exclude this.
> >> For example,
> >> ^((?!LyX.*).)*$
> >> does not work.
> >> -Joon
> >> On Thu, 19 Jan 2012 09:54:24 -0600, Al <itscoolrea...@gmail.com> wrote:
> >> > Hi Joon,
> >> > Ironically, I replaced all of your text for "Virtualbox OSE" with
> >> > "gedit". I then made sure I have several apps open that would respond
> >> > to my macro including a gedit window. It was the gedit window that
> >> > didn't react to the macro, not until i changed the regex enough to
> >> > make it the match mechanism not recognize the gedit window. So, I
> >> > performed no real magic here. However, I can think of one thing, if
> >> > your window title text is not matching entirely, ie, does it end in
> >> > OSE or is it ending in OSE and a letter? I ask because the last '.'
> >> > means match one character. I want you try leaving off that last '.'
> >> > and seeing what happens. In the meantime i'm installing virtualbox-ose
> >> > to see if i duplicate your problem.
> >> > - al
> >> > On Jan 18, 9:58 pm, "Joon Ro" <joonp...@gmail.com> wrote:
> >> >> Hi Al,
> >> >> Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The
> >> system
> >> >> python version is 2.7.2.
> >> >> Can you please show me what did you use to exclude gedit? Maybe I can
> >> >> try
> >> >> your regex.
> >> >> -Joon
> >> >> On Wed, 18 Jan 2012 20:38:24 -0600, Al <itscoolrea...@gmail.com>
> >> wrote:
> >> >> > Joon,
> >> >> > Ok, so I looked at the re.search information at python to
> >> understand
> >> >> > that filter better, then I made one of my own but for gedit
> >> windows.
> >> >> > And it worked great, I could successfully cause my macro to not
> >> run in
> >> >> > windows matching that portion of the title but run in others. So
> >> what
> >> >> > version of Ubuntu, python and autokey are you running?
> >> >> > -Al
> >> >> > On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:
> >> >> >> Hi Al,
> >> >> >> Thanks for the reply. The thing is I am trying to exclude some
> >> >> windows,
> >> >> >> not include.
> >> >> >> -Joon
> >> >> >> On Wed, 18 Jan 2012 09:02:50 -0600, Al <itscoolrea...@gmail.com>
> >> >> wrote:
> >> >> >> > Joon,
> >> >> >> > Try taking all the regex stuff out and using simple wildcards,
> >> >> which
> >> >> >> > work for me. Try *VirtualBox*.
> >> >> >> > - Al
> >> >> >> > On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote:
> >> >> >> >> Hi,
> >> >> >> >> One of the discussions Chris said:
> >> >> >> >> To match in all windows except one with a certain title is a
> >> >> little
> >> >> >> >> trickier
> >> >> >> >> as regexes do not provide a straight-forward way of doing so.
> >> >> >> >> However, the
> >> >> >> >> following should work:
> >> >> >> >> ^((?!.*VirtualBox OSE).)*$
> >> >> >> >> The above assumes that the window title ends on VirtualBox OSE.
> >> >> Any
> >> >> >> >> window
> >> >> >> >> titles that end on this will NOT trigger a match, and any that
> >> >> >> don't,
> >> >> >> >> will.
> >> >> >> >> I tried this but it is not working for me. (I'm using autokey
> >> >> 0.81.4)
> >> >> >> >> First of all, in normal python console,
> >> >> >> >> Does not give me any match. So it seems the regex is not
> >> matching
> >> >> the
> >> >> >> >> string even though it does not end with VirtualBox OSE.
> >> >> >> >> Anyway, at least it is excluding any string with VirtualBox
> >> OSE,
> >> >> so I
> >> >> >> >> tried to set it in my window filter, but whatever window name I
> >> >> try
> >> >> >> it
> >> >> >> >> did not work.
> >> >> >> >> Could you please give me some help on this?
So this is the log. I grabbed only part where it happens. I tried this with 'opera.OperaNext' window. I have a script with
Abbreviations: \a "Omit trigger character" is the only thing checked
and the script content is:
title = window.get_active_title() if title.find('LyX:') == -1: keyboard.send_keys('lpha')
I tried several times, and it worked, until suddenly autokey automatically changes the window to 'terminator.Terminator' and then just hangs. So whatever I do, after the last two lines of the log, nothing happens. No error message, anything. I haven't done the livescreen thing yet but I will try to do that when I have time. Thanks a lot for your help!
-Joon
2012-01-22 14:48:31,554 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:31,557 DEBUG - service - Input stack at end of handle_keypress: [' ', ' ', '\n', '\n'] 2012-01-22 14:48:31,887 DEBUG - service - Raw key: u'\\', modifiers: [], Key: \ 2012-01-22 14:48:31,887 DEBUG - service - Window visible title: u'Re: window filter exclusion does not work - Opera Next', Window class: 'opera.OperaNext' 2012-01-22 14:48:31,887 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:31,889 DEBUG - service - Input stack at end of handle_keypress: [' ', ' ', '\n', '\n', u'\\'] 2012-01-22 14:48:32,007 DEBUG - service - Raw key: u'a', modifiers: [], Key: a 2012-01-22 14:48:32,007 DEBUG - service - Window visible title: u'Re: window filter exclusion does not work - Opera Next', Window class: 'opera.OperaNext' 2012-01-22 14:48:32,007 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:32,009 DEBUG - service - Input stack at end of handle_keypress: [' ', ' ', '\n', '\n', u'\\', u'a'] 2012-01-22 14:48:32,159 DEBUG - service - Raw key: u' ', modifiers: [], Key: 2012-01-22 14:48:32,160 DEBUG - service - Window visible title: u'Re: window filter exclusion does not work - Opera Next', Window class: 'opera.OperaNext' 2012-01-22 14:48:32,160 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:32,161 DEBUG - service - Script runner executing: Script('alpha') 2012-01-22 14:48:32,161 DEBUG - service - Input stack at end of handle_keypress: [] 2012-01-22 14:48:32,161 DEBUG - interface - Send special key: ['<backspace>'] 2012-01-22 14:48:32,170 DEBUG - service - Ignored locking error in handle_keypress 2012-01-22 14:48:32,171 DEBUG - iomediator - Send via event interface 2012-01-22 14:48:32,178 DEBUG - interface - Sending string: u'lpha' 2012-01-22 14:48:32,671 DEBUG - service - Raw key: u' ', modifiers: [], Key: 2012-01-22 14:48:32,671 DEBUG - service - Window visible title: u'Re: window filter exclusion does not work - Opera Next', Window class: 'opera.OperaNext' 2012-01-22 14:48:32,673 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:32,675 DEBUG - service - Input stack at end of handle_keypress: [' '] 2012-01-22 14:48:33,000 DEBUG - service - Raw key: u'\\', modifiers: [], Key: \ 2012-01-22 14:48:33,001 DEBUG - service - Window visible title: u'Re: window filter exclusion does not work - Opera Next', Window class: 'opera.OperaNext' 2012-01-22 14:48:33,001 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:33,003 DEBUG - service - Input stack at end of handle_keypress: [' ', u'\\'] 2012-01-22 14:48:33,071 DEBUG - service - Raw key: u'a', modifiers: [], Key: a 2012-01-22 14:48:33,071 DEBUG - service - Window visible title: u'Re: window filter exclusion does not work - Opera Next', Window class: 'opera.OperaNext' 2012-01-22 14:48:33,071 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:33,073 DEBUG - service - Input stack at end of handle_keypress: [' ', u'\\', u'a'] 2012-01-22 14:48:33,167 DEBUG - service - Raw key: u' ', modifiers: [], Key: 2012-01-22 14:48:33,167 DEBUG - service - Window visible title: u'Re: window filter exclusion does not work - Opera Next', Window class: 'opera.OperaNext' 2012-01-22 14:48:33,167 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:33,168 DEBUG - service - Input stack at end of handle_keypress: [] 2012-01-22 14:48:33,168 DEBUG - service - Ignored locking error in handle_keypress 2012-01-22 14:48:33,168 DEBUG - service - Script runner executing: Script('alpha') 2012-01-22 14:48:33,169 DEBUG - interface - Send special key: ['<backspace>'] 2012-01-22 14:48:33,178 DEBUG - iomediator - Send via event interface 2012-01-22 14:48:37,022 DEBUG - interface - Sending string: u'lpha' 2012-01-22 14:48:37,025 DEBUG - service - Raw key: u'\\', modifiers: [], Key: \ 2012-01-22 14:48:37,026 DEBUG - service - Window visible title: u'autokey-gtk -l > autokeyerror.log', Window class: 'terminator.Terminator' 2012-01-22 14:48:37,026 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:37,028 DEBUG - service - Input stack at end of handle_keypress: [u'\\'] 2012-01-22 14:48:37,030 DEBUG - service - Raw key: u'a', modifiers: [], Key: a 2012-01-22 14:48:37,030 DEBUG - service - Window visible title: u'autokey-gtk -l > autokeyerror.log', Window class: 'terminator.Terminator' 2012-01-22 14:48:37,030 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:37,032 DEBUG - service - Input stack at end of handle_keypress: [u'\\', u'a'] 2012-01-22 14:48:37,135 DEBUG - service - Raw key: u' ', modifiers: [], Key: 2012-01-22 14:48:37,136 DEBUG - service - Window visible title: u'joon@linux-0sd0: ~/sources/Gnome-Pie', Window class: 'terminator.Terminator' 2012-01-22 14:48:37,136 DEBUG - service - No phrase/script matched hotkey 2012-01-22 14:48:37,138 DEBUG - service - Input stack at end of handle_keypress: [] 2012-01-22 14:48:37,138 DEBUG - service - Ignored locking error in handle_keypress 2012-01-22 14:48:37,138 DEBUG - service - Script runner executing: Script('alpha') 2012-01-22 14:48:37,160 DEBUG - iomediator - Send via event interface
On Sun, 22 Jan 2012 08:32:41 -0600, Al <itscoolrea...@gmail.com> wrote: > Hi Joon,
> I had the behavioral problem back in the 0.7x version. But when I > upgraded it went away. The only prime difference between us now is the > distribution type. Let us see if we can evoke even more error messages > from autokey, make sure it is not running and from terminal do: > "autokey-gtk -l", this way a ton of verbose message will write to > console. Then open your "LyX" thing or TERMINAL that you were testing > in and see what you get. Hopefully you'll get an error traceback that > Chris can use to debug the system or that one of us can use to figure > out the exact nature of the problem you are having now.
> Btw, I like how you reduced what I did there.
> - Al
> On Jan 22, 1:01 am, "Joon Ro" <joonp...@gmail.com> wrote: >> Hi Al,
>> Thanks again for your reply. I tried the following:
>> title = window.get_active_title() >> if title.find('LyX:') == -1: >> keyboard.send_keys('test string')
>> with some abbreviation. I just used str.find() instead of importing re >> module. >> It seems to be working, but strangely within 2 or 3 tries, autokey >> freezes. >> I don't know what is going on, but when I run autokey from the terminal >> to >> see any messages, >> when autokey freezes, autokey types the 'test string' in the TERMINAL >> window instead of >> whatever window I had evoked the script.
>> Are you having any autokey freezing problem with the script?
>> -Joon
>> On Fri, 20 Jan 2012 13:36:06 -0600, Al <itscoolrea...@gmail.com> wrote: >> > Joon,
>> > Sorry for the repeated postings. So it looks like you are doing this >> > from a terminal. So I opened my terminal and starting fiddling and lo >> > and behold, I couldn't get my terminal window to except either with >> > the filtering thing. But I did notice some interesting functions in >> > autokey like get_window_title() so I decided to use that plus some of >> > the more simpler re.search() capabilities of python. If you put the >> > following at the top of your script, I believe you will have no >> > problem excluding your LyX windows.
>> > import re >> > t = window.get_active_title() >> > m = re.search("LyX", t) >> > if m==None: >> > # code to execute if 'LyX' is not in the title >> > # ... >> > # more code >> > # ... >> > # etc ... >> > else: >> > # code to execute if 'Lyx' IS IN the title >> > # ... >> > # more code >> > # ... >> > # etc ...
>> > I know that is bit contrived up there, I did it just in case someone >> > doesn't entirely understand python and wanted to do the same thing. >> > Hopefully it'll help them. But using that code structure I was able to >> > exclude my terminal window which started as "alan@homefront" and >> > instead of 'LyX' and I had used 'alan' in line 3.
>> > Enjoy,
>> > Al
>> > On Jan 19, 9:11 pm, "Joon Ro" <joonp...@gmail.com> wrote: >> >> Hi Al,
>> >> Thank you very much for your help. >> >> I just tried gedit as well and gedit case it seems to be working for >> me >> >> as >> >> well. >> >> And please don't install Virtualbox OSE because that was the example >> >> chris >> >> was using, >> >> and I'm not having trouble with that.
>> >> Let me give you one of my example. I want to exclude the LyX window. >> >> My LyX window's title is
>> >> LyX: ~/workspace/newfile1.lyx
>> >> And whatever I try, I cannot make autokey to exclude this. >> >> For example,
>> >> ^((?!LyX.*).)*$
>> >> does not work.
>> >> -Joon
>> >> On Thu, 19 Jan 2012 09:54:24 -0600, Al <itscoolrea...@gmail.com> >> wrote: >> >> > Hi Joon,
>> >> > Ironically, I replaced all of your text for "Virtualbox OSE" with >> >> > "gedit". I then made sure I have several apps open that would >> respond >> >> > to my macro including a gedit window. It was the gedit window that >> >> > didn't react to the macro, not until i changed the regex enough to >> >> > make it the match mechanism
I found that it's because the filter means (1) it matches to the
Window title or (2) it matches to the Window class.
src/lib/model.py
268 def _should_trigger_window_title(self, windowInfo):
269 r = self.get_applicable_regex()
270 if r is not None:
271 return r.match(windowInfo[0]) or
r.match(windowInfo[1])
272 else:
273 return True
line 271 is the key.
So if you want to exclude a Window, you always have to specify a
keyword that doesn't match neither its title nor class. I think
"VirtualBox OSE" is a good keyword for the title but I don't think it
unmatches to the class.
This issue is basically caused by the asymmetricity of matching/
unmatching. I propose that autokey provides negate option in the
Window filtering.
On Jan 17, 12:24 pm, Joon <joonp...@gmail.com> wrote:
> To match in all windows except one with a certain title is a little
> trickier
> as regexes do not provide a straight-forward way of doing so.
> However, the
> following should work:
> ^((?!.*VirtualBox OSE).)*$
> The above assumes that the window title ends on VirtualBox OSE. Any
> window
> titles that end on this will NOT trigger a match, and any that don't,
> will.
> I tried this but it is not working for me. (I'm using autokey 0.81.4)
> First of all, in normal python console,
> >>> re.search('^((?!.*VirtualBox OSE).)*$', 'asrtas VirtualBox OSE trsietnsri')
> Does not give me any match. So it seems the regex is not matching the
> string even though it does not end with VirtualBox OSE.
> Anyway, at least it is excluding any string with VirtualBox OSE, so I
> tried to set it in my window filter, but whatever window name I try it
> did not work.
> I found that it's because the filter means (1) it matches to the
> Window title or (2) it matches to the Window class.
> src/lib/model.py
> 268 def _should_trigger_window_title(self, windowInfo):
> 269 r = self.get_applicable_regex()
> 270 if r is not None:
> 271 return r.match(windowInfo[0]) or
> r.match(windowInfo[1])
> 272 else:
> 273 return True
> line 271 is the key.
> So if you want to exclude a Window, you always have to specify a
> keyword that doesn't match neither its title nor class. I think
> "VirtualBox OSE" is a good keyword for the title but I don't think it
> unmatches to the class.
> This issue is basically caused by the asymmetricity of matching/
> unmatching. I propose that autokey provides negate option in the
> Window filtering.
> On Jan 17, 12:24 pm, Joon <joonp...@gmail.com> wrote:
> > Hi,
> > One of the discussions Chris said:
> > To match in all windows except one with a certain title is a little
> > trickier
> > as regexes do not provide a straight-forward way of doing so.
> > However, the
> > following should work:
> > ^((?!.*VirtualBox OSE).)*$
> > The above assumes that the window title ends on VirtualBox OSE. Any
> > window
> > titles that end on this will NOT trigger a match, and any that don't,
> > will.
> > I tried this but it is not working for me. (I'm using autokey 0.81.4)
> > First of all, in normal python console,
> > >>> re.search('^((?!.*VirtualBox OSE).)*$', 'asrtas VirtualBox OSE trsietnsri')
> > Does not give me any match. So it seems the regex is not matching the
> > string even though it does not end with VirtualBox OSE.
> > Anyway, at least it is excluding any string with VirtualBox OSE, so I
> > tried to set it in my window filter, but whatever window name I try it
> > did not work.
> to only check the window class, and I specified keywords only about
> window class. It worked for me.
> On Jan 22, 2:02 pm, uj <ujih...@gmail.com> wrote:
> > I found that it's because the filter means (1) it matches to the
> > Window title or (2) it matches to the Window class.
> > src/lib/model.py
> > 268 def _should_trigger_window_title(self, windowInfo):
> > 269 r = self.get_applicable_regex()
> > 270 if r is not None:
> > 271 return r.match(windowInfo[0]) or
> > r.match(windowInfo[1])
> > 272 else:
> > 273 return True
> > line 271 is the key.
> > So if you want to exclude a Window, you always have to specify a
> > keyword that doesn't match neither its title nor class. I think
> > "VirtualBox OSE" is a good keyword for the title but I don't think it
> > unmatches to the class.
> > This issue is basically caused by the asymmetricity of matching/
> > unmatching. I propose that autokey provides negate option in the
> > Window filtering.
> > On Jan 17, 12:24 pm, Joon <joonp...@gmail.com> wrote:
> > > Hi,
> > > One of the discussions Chris said:
> > > To match in all windows except one with a certain title is a little
> > > trickier
> > > as regexes do not provide a straight-forward way of doing so.
> > > However, the
> > > following should work:
> > > ^((?!.*VirtualBox OSE).)*$
> > > The above assumes that the window title ends on VirtualBox OSE. Any
> > > window
> > > titles that end on this will NOT trigger a match, and any that don't,
> > > will.
> > > I tried this but it is not working for me. (I'm using autokey 0.81.4)
> > > First of all, in normal python console,
> > > >>> re.search('^((?!.*VirtualBox OSE).)*$', 'asrtas VirtualBox OSE trsietnsri')
> > > Does not give me any match. So it seems the regex is not matching the
> > > string even though it does not end with VirtualBox OSE.
> > > Anyway, at least it is excluding any string with VirtualBox OSE, so I
> > > tried to set it in my window filter, but whatever window name I try it
> > > did not work.
On Sun, 22 Jan 2012 18:14:08 -0600, Al <itscoolrea...@gmail.com> wrote:
> On Jan 22, 4:09 pm, uj <ujih...@gmail.com> wrote: >> I personally changed the line 271 to
>> return r.match(windowInfo[1])
>> to only check the window class, and I specified keywords only about >> window class. It worked for me.
It worked like a charm. Thanks!
>> > This issue is basically caused by the asymmetricity of matching/ >> > unmatching. I propose that autokey provides negate option in the >> > Window filtering.