[feature] focus application based on pid --- accepted

Asked by Chetan

track at https://github.com/RaiMan/SikuliX1/issues/307
------------------------------------------------------------------------------------

i have an application that is running and i know hte pid based on getprocess in powershell
i would like that application to come to focus. how can i do that?
app.focus(pid) does not work

i am getting app process by below command
cmd='powershell\n Get-Process | Where-Object { $_.MainWindowTitle -Match \"Adobe Acrobat\" }| Where-Object { $_.Name -Match \"Acrobat\" } | Format-Table ID,Name,Mainwindowtitle -AutoSize'

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ben Dix (bendix80) said (last edit ):
#1

Hey 😄

maybe cmdow can help you.
I am using this additional cmd tool to resize, activate, hide and arrange windows of any application on win10.

in Sikuli IDE i am using

align_window = """
powershell
cmdow "WINDOWNAME" /MOV 0 0 /SIZ 400 742
"""
returnCode = runScript(align_window)

greetings

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

2.0.6 will have
app = App.withPID(pid)

if valid, then app can be used normally.

Revision history for this message
Chetan (cshamdas) said :
#4

thanks Raiman. any update by when can we have the build 2.0.6

Revision history for this message
RaiMan (raimund-hocke) said :
#5

Due to private priorities the final 2.0.6 will only be available towards end of the year.

Until then you have to try with the snapshots: https://github.com/RaiMan/SikuliX1