How to iterate items of the window with dynamic title
The simplest way is using the Application's bundle identifier. This can be found from reading the Info.plist file within the application package, or with some simple AppleScript such as:
get id of application "TextEdit"
This returns com.apple.TextEdit
.
Then, one could run the following AppleScript:
tell application id "com.apple.TextEdit"
activate
end tell
So, your revised could would look like this (note use of process id
since you're using System Events).
-- set bundleId to id of application "AppName"
set bundleId to "com.apple.TextEdit"
tell application id bundleId to activate
tell application "System Events"
repeat with theProcessId in (processes whose bundle identifier is bundleId)
tell process id (id of theProcessId)
tell tab group 1 of window 1
set items to every row of table 1 of scroll area 1
set itemValues to {}
repeat with aRow in items
set itemValue to (value of text field 1 of aRow)
log itemValue
set the end of itemValues to itemValue
end repeat
end tell
end tell
end repeat
end tell