Hi, guys,
I am new to scripting, and I got stuck on something simple. Would you please look at the following script.
tell application "System Events"
global x
set x to the application processes whose name contains "XYZ"
set x to item 1 of x
global y
set y to windows of x
set y to item 1 of y
global theName
set theName to the name of y
get theName
end tell
tell application "System Events"
tell process "XYZ"
-- GUI Scripting statements:
select row 1 of outline 1 of window theName
end tell
end tell
When the window of the application I script is on the desktop the skript works. When the window is mininmized to the Dock, the script cannot address the window.
I tried to address the window directly, and it worked even if the window was minimized. The only thing was that the application added a number to the window each time I open the application, so I tried to make the script to ignore a part of the window’s name.
All comments are welcome.
Thank you in advance.