My Chrome-script is in the middle of a “tell front window”-statement when I need to count the numbers of windows and send as an argument to another handler in a “oneliner”. Is that possible? Everything I have tried so far returns error messages.
Basically my non-working code is
tell application "Google Chrome"
tell front window
myHandler "count: " & (tell application "Google Chrome" to count windows)
end tell
end tell
The problem is that set winCount to tell application "Google Chrome" to count windows
doesn’t work and instead have to be written like this tell application "Google Chrome" to set winCount to count windows
.
The code would work if it looked like this
tell application "Google Chrome"
myHandler "count: " & (count windows)
end tell
but I don’t really understand what the difference is!?