Wildcard with xdotool


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu Wildcard with xdotool
# 1  
Old 03-04-2019
Wildcard with xdotool

The window id for the particular popup window is different each time, so this scripts often does not work.


Is there a way I could use a wildcard ?


Ex. xdotool key --window 1677*.* alt+F4

or go through all the relevant window IDs and filter what I need and discard the rest.

This gives me the correct window id.

Code:
xdotool search --name "Error" > Window_IDs.txt

I just need it to substitute the value it gets for the 16777491 xdotool key --window 16777491 alt+F4


Code:
#!/bin/bash
    # xdotool selectwindow This determines the window id or 2nd method
    # xdotool search --name "Error"
    #
    # Does not work because for some reason, the window id is different every time ?
    xdotool key --window 16777491 alt+F4
    # 
    #16777782
    #16777491
    #16778087
     #

I have provided ALL the info that I think pertains to this help request.

Last edited by RudiC; 03-05-2019 at 06:04 AM..
# 2  
Old 03-05-2019
Quote:
Originally Posted by drew77
The window id for the particular popup window is different each time, so this scripts often does not work.


Is there a way I could use a wildcard ?


Ex. xdotool key --window 1677*.* alt+F4

or go through all the relevant window IDs and filter what I need and discard the rest.

This gives me the correct window id.

xdotool search --name "Error" > Window_IDs.txt

I just need it to substitute the value it gets for the 16777491 xdotool key --window 16777491 alt+F4


Code:
#!/bin/bash
    # xdotool selectwindow This determines the window id or 2nd method
    # xdotool search --name "Error"
    #
    # Does not work because for some reason, the window id is different every time ?
    xdotool key --window 16777491 alt+F4
    # 
    #16777782
    #16777491
    #16778087
     #

I have provided ALL the info that I think pertains to this help request.
Not even close...

When you type in the command xdotool selectwindow, exactly what output do you get? (Please put the response to this question in CODE tags.)

When you type in the command xdotool search --name "Error" what output do you get? (Please put the response to this question in CODE tags.)

Out of the apparently tens of millions of window IDs xdotool creates, how are we supposed to know which one is the one you're looking for?
# 3  
Old 03-05-2019
You did not pay very good attention to my post.


-- The window id for the particular popup window is different each time, so this scripts often does not work.


So your 2 question are not relevant.
# 4  
Old 03-05-2019
Quote:
Originally Posted by drew77
You did not pay very good attention to my post.


-- The window id for the particular popup window is different each time, so this scripts often does not work.


So your 2 question are not relevant.
Presumably, according to you, those tools give you output that contains the window IDs you want. If that isn't relevant to getting the results you want, I have no idea how we can help you.

If you're unwilling to show us sample output produced by those commands, we have no way of knowing what the format of the output produced by those commands might be.

If you are just going to dismiss our questions as an unreasonable waste of your time, then any attempt on our part to help you is a waste of our time.

I'm am sorry that I wasted your time trying to help you. I won't make that mistake again.
# 5  
Old 03-05-2019
Quote:
Originally Posted by Don Cragun
Presumably, according to you, those tools give you output that contains the window IDs you want. If that isn't relevant to getting the results you want, I have no idea how we can help you.

If you're unwilling to show us sample output produced by those commands, we have no way of knowing what the format of the output produced by those commands might be.

If you are just going to dismiss our questions as an unreasonable waste of your time, then any attempt on our part to help you is a waste of our time.

I'm am sorry that I wasted your time trying to help you. I won't make that mistake again.
The commands produce simple numbers as shown in my post.


I would think you would test my xdotools command to learn how it works. Maybe I should not have assumed that?


Code:
#16777782 #16777491 #16778087

When I do my best, but am criticized, I start to wonder if someone is really tried to help me or just complain.

Last edited by drew77; 03-05-2019 at 01:35 AM..
# 6  
Old 03-05-2019
I do not have access to an Ubuntu system. I do not have access to, nor do I have any desire to load, learn how to run, nor run xdotool when, as far as I know, I have no need to have or use xdotool (especially when you tell me that it doesn't work well).

I do, however, have over 45 years of experience using UNIX tools to solve all sorts of problems and I would love to help you learn how to extract the window ID number out of the output from an xdotool selectwindow or xdotool search --name "Error" command if you'll explain to me where the window ID number that you want appears in the output produced by those commands. Telling me that they only produce "simple numbers" without knowing how many simple numbers each of them produces nor which of those simple numbers is the one you want nor what separates those simple numbers in the output of those commands doesn't really tell me anything I can use to help you.

If you would actually show me the exact output produced by one of those commands and explain to me which of the simple numbers output by one or both of those programs is the one and only window ID that you want to use in a subsequent xdotool key --window "window_ID" command on that instance of that system, I'd be happy to help you learn how to do that. But, if you think it is my duty to buy an Ubuntu system, load xdotool on it, learn how to run xdotool and then explain how xdotool works to you; I'm sorry, but that is not my job, is not in my budget, and is not something I have any interest in doing.

Last edited by Don Cragun; 03-05-2019 at 02:51 AM.. Reason: Fix typo : s/search search/search/
# 7  
Old 03-05-2019
Quote:
Originally Posted by drew77
T
I would think you would test my xdotools command to learn how it works. Maybe I should not have assumed that?.
I nearly fell out of my chair when I read your statement statement above.

Why would you assume that?

When people, especially the ones here with decades of hands on UNIX and Linux experience, ask you for information, you should provide the info they ask for without hesitation.

Most people with decades of experience have realized that the vast majority of user errors and issues are general and they can be solved by looking at the input and output of the system, the log files and the operating environment.

We find that most users with problems do not even read their only system log files and we need to ask them to look at their own log files, believe it or not (shocking!?) . Smilie

So, we don't need to install every tool and every operating system on the planet to help you, but you do need to provide the system information we request.

That's how it works.

So, please provide the information Don requested.

Thanks.
These 2 Users Gave Thanks to Neo For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with xdotool and XOJO

I am trying to place and size a window on Mac using XOJO as my coding app. I am NOT in Terminal. Needs to be run as a shell I guess, but I don't know how to get the variable or set the variable. Here is a line of code that opens a folder: Dim sh As New Shell() sh.Execute("open... (1 Reply)
Discussion started by: sbrady
1 Replies

2. OS X (Apple)

Help with wildcard

CD_numb is AM017 this code: set the_Firstcom_CD to (do shell script "ls -d '/volumes/audioNAS/Firstcom/Access Music/' ") & CD_numb gives me this: "/volumes/audioNAS/Firstcom/Access Music/AM017" the item I am looking for is AM017Q. I can get the "*" syntax right so it never finder... (7 Replies)
Discussion started by: sbrady
7 Replies

3. Shell Programming and Scripting

Wildcard in ls

Hi Experts, I want to use ls in the below form: ls -l *.{txt,TXT} (working fine) but when i am declaring a variable, VAR="*.{txt,TXT}" ls -l $VAR is not working. Please help. Thanks. (4 Replies)
Discussion started by: sugarcane
4 Replies

4. Shell Programming and Scripting

Sed Wildcard

Hello, I apologize for asking what is probably a simple question but I have been unable to understand the other posts on the topic. I have a file that has the following several lines: ABC DEF GH:IJKLMNOP_QRS_TUV_11112012_ABCL5 ABC DEF GH:IJKLMNOP_QRS_TUV_11112013_ABCL4 ABC DEF... (4 Replies)
Discussion started by: MolecularToast
4 Replies

5. Shell Programming and Scripting

wildcard help!!

i have got heaps of files (.pdf, .txt and .doc) files in one folder, i am making a program in PERL that helps me find the files i want easier using shell wildcard, something like this!! print "Enter a pattern: (must be in )"; $input = <STDIN>; if (The input is in and valid wildcard... (3 Replies)
Discussion started by: bshell_1214
3 Replies

6. Shell Programming and Scripting

How to use wildcard * in if?

Hi, Can anyone help me how to use * in if statement. File contains below line1:a|b|c|Apple-RED| line2:c|d|e|Apple-Green| line3:f|g|h|Orange| I need to find line by line 4th field contains 'Apple' or not. Please help me at the earliest. (6 Replies)
Discussion started by: jam_prasanna
6 Replies

7. UNIX for Advanced & Expert Users

wildcard help

Can someone please explain the wildcards in this. How is this recursive? When I put this in my terminal it recursively displayed everything. ls .* * (6 Replies)
Discussion started by: cokedude
6 Replies

8. Shell Programming and Scripting

wildcard

Hi, I have this code to search all "cif" files using wildcard for file in *.cif do grep "Uiso" $file | awk '{ print $3, $4, $5 }' > tet done I get this error "grep: *.cif: No such file or directory" Please where am I going wrong!!! Thank you in advance (6 Replies)
Discussion started by: princessotes
6 Replies

9. UNIX for Dummies Questions & Answers

wildcard

what will the cmd below do? ls *.3 1 members mentions that to seek all permutations and combinations of the mp3 extension ill have to use curly braces, {} and not, . what then will do? (13 Replies)
Discussion started by: abhi
13 Replies

10. UNIX for Dummies Questions & Answers

Find wildcard .shtml files in wildcard directories and removing them- How's it done?

I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days... The structure of the paths are like this: /home/domains/www.domain2.com/tgp/ /home/domains/www.domain3.com/tgp/... (1 Reply)
Discussion started by: Neko
1 Replies
Login or Register to Ask a Question