Errors in natlink console on Mac when iTerm 2 is the current window
dylan-chong opened this issue · 2 comments
dylan-chong commented
dylan-chong commented
It is caused by this code (line 265 of server/osx/server_osx.py
).
script = applescript.AppleScript('''
global frontApp, frontAppName, windowTitle
set windowTitle to ""
tell application "System Events"
set frontApp to first application process whose frontmost is true
set frontAppName to name of frontApp
tell process frontAppName
tell (1st window whose value of attribute "AXMain" is true)
set windowTitle to value of attribute "AXTitle"
end tell
end tell
end tell
return {frontAppName, windowTitle}
''')
I will have a play with the script and see if I can default to ignoring AXMain, no guarantees I can fix it
dylan-chong commented
Looks like iTerm2 (or any app without the title bar) means that there is no window whose value of attribute "AXMain" is true
. I am working on a script to default to the frontmost window.