I have a number of macros which help me to automate Google Chrome in various ways. They have worked fine for a while.
Today these macros stopped working. What they all have in common is that the property active tab will no longer compile in either Script Editor or Keyboard Maestro.
Any idea why this used to work but now has stopped working?
Chrome doesn't always have any open windows, but provided that it does, this seems to be working:
tell application "Google Chrome"
if 0 < (count of windows) then
tell front window
{title, URL} of active tab
end tell
else
"No windows open in Chrome"
end if
end tell
with Chrome Version 86.0.4240.198 (Official Build) (x86_64)
While that syntax works, I realized the problem is that for some reason Neither KM nor Script Editor is responded to application "Google Chrome" - I have to instead change it to application "Chrome" and then it compiles and it switched to application "Google Chrome."
tell application id "com.google.Chrome"
path to it
end tell
If that fails to work then try using the specific path:
tell application "Mercury:Applications:Applications_Chris:Internet_Apps:Web_Browser_Apps:Google Chrome:Google Chrome.app:"
path to it
end tell
Get the path using this script:
tell application "Finder" to set finderSelectionList to selection as alias list
if length of finderSelectionList = 0 then error "No files were selected in the Finder!"
set theItem to item 1 of finderSelectionList as text
set the clipboard to "\"" & theItem & "\""