Quintus / Automations

Automations is a Ruby 1.9 project consisting of libraries to fake and simulate (automate) user input like pressing keys or moving windows. Linux X server systems can be automated by using xdotool internally, Windows systems by using AutoItX3.
30 stars 8 forks source link

Find window with regex or exclude title #8

Closed cantonic closed 6 years ago

cantonic commented 12 years ago

Hi,

I need to wait for a window which does NOT contain a specific string in title. Is that possible in some way? Maybe through regex?

Quintus commented 12 years ago

First, note I’m not developing this actively anymore. I cannot guarantee that the au3 and xdo projects work at all anymore.

Maybe through regex?

Yes. You can use a negative look-ahead construct such as:

# ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
irb(main):001:0> str = "Foo"
=> "Foo"
irb(main):002:0> str.match(/Bar/)
=> nil
irb(main):003:0> str.match(/(?!Bar)/)
=> #<MatchData "">
irb(main):004:0> 

Vale, Quintus

Quintus commented 6 years ago

I don't work on this project anymore.