There is already a topic on the text field being focused.
https://forum.keyboardmaestro.com/t/can-i-check-if-i-am-in-a-text-field/7251/9
Here's my current script which is inserting "true" after I rename the file and press "enter". How do I
get it to just save the filename I type?
tell application "System Events"
tell application process "Capture One 20"
set frontmost to true
tell (first window whose subrole is "AXStandardWindow")
try
set subjElem to (first text field of scroll area 1 of group 2)
set subjProp to properties of subjElem
set subjFocused to focused of subjElem
return subjFocused
on error
tell application "Capture One 20"
begin live view
end tell
end try
end tell
end tell
end tell