- Registriert
- 31.08.15
- Beiträge
- 3
Hallo liebe Apfeltalker,
ich versuche den BadgeText (Anzahl ungelesener Mails) des GMail-Tabs in Google Chrome mit AppleScript auszulesen, schaffe es aber leider nicht. Es sollte in JavaScript irgendwie mit (chrome.browserAction.getBadgeText(object details,function callback)" funktionieren.
Ich habe geschafft mit folgendem AppleScript den Inhalt des Tabs auszulesen:
Ich habe versucht die Zeile
mit etwas wie
zu ersetzen. Leider ohne Erfolg.
Hat jemand eine Idee?
Schöne Grüße
Alex
ich versuche den BadgeText (Anzahl ungelesener Mails) des GMail-Tabs in Google Chrome mit AppleScript auszulesen, schaffe es aber leider nicht. Es sollte in JavaScript irgendwie mit (chrome.browserAction.getBadgeText(object details,function callback)" funktionieren.
Ich habe geschafft mit folgendem AppleScript den Inhalt des Tabs auszulesen:
Code:
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set chromeRunning to is_running("Google Chrome")
if chromeRunning then
--Set the URL of the website here
set URLtoLookAndCheckBadge to "https://mail.google.com"
tell application "Google Chrome"
set foundit to false
set j to 0
repeat with w in (windows)
set j to j + 1
set i to 0
set windowid to id of window j
--Search tabs only if window is not sidewise (chrome-plugin)
if title of active tab of window id windowid is not "Sidewise" then
repeat with t in (tabs of w)
set i to i + 1
if URL of t starts with URLtoLookAndCheckBadge then
set foundit to true
return execute t javascript "document.body.innerText"
end if
end repeat
end if
if foundit then
exit repeat
end if
end repeat
end tell
end if
Ich habe versucht die Zeile
Code:
return execute t javascript "document.body.innerText"
Code:
return execute t javascript "chrome.browserAction.getBadgeText({}, function (TheBadgeText) {return TheBadgeText;});"
Hat jemand eine Idee?
Schöne Grüße
Alex