Hallo,
vielleicht kann mir jemand helfen. Mti chatgpt habe ich mri folgendes apple script gebastelt.
-- AppleScript zur automatisierten Früherkennung in Tomedo mit Doppelklick auf ganze Tabellenzeile (statt static text)
-- Beispielwerte
set patient_id to "1"
set eintrags_datum to "10.05.2023"
-- Tomedo aktivieren
tell application "tomedo" to activate
delay 2
set timeoutSeconds to 2.0
-- Suchfeld fokussieren (zur Sicherheit)
set uiScript to "click text field 1 of window 1 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.3
-- CMD + F → Patientensuche
set uiScript to "keystroke \"f\" using command down"
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.5
-- Patient ID eingeben
set uiScript to "keystroke \"" & patient_id & "\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 1.2
-- ENTER drücken
set uiScript to "keystroke return"
my doWithTimeout(uiScript, timeoutSeconds)
delay 4.5
-- Doppelklick auf ganze Tabellenzeile
repeat 2 times
set uiScript to "click row 1 of table 1 of scroll area 2 of splitter group 1 of window 1 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.2
end repeat
delay 2.0
-- Früherkennungsmodul öffnen (Ctrl+Option+Cmd+V)
set uiScript to "keystroke \"v\" using {control down, option down, command down}"
my doWithTimeout(uiScript, timeoutSeconds)
delay 2
-- Auf „Vergangene bearbeiten“ klicken
set uiScript to "click UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 1
-- Auf „+“-Eintrag klicken
set uiScript to "click UI element 4 of UI element 1 of UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 1
-- Datum setzen
set uiScript to "click UI element 1 of UI element 1 of row 1 of table 1 of scroll area 1 of UI element 1 of UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.5
set uiScript to "keystroke \"" & eintrags_datum & "\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 1
-- Checkboxen „aufgeklärt“ und „untersucht“
repeat with i from 2 to 3
set uiScript to "click checkbox 1 of UI element " & i & " of row 1 of table 1 of scroll area 1 of UI element 1 of UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.5
end repeat
delay 1
-- OK klicken
set uiScript to "click UI element \"OK\" of UI element 1 of UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
-- ESC zum Schließen
delay 3
set uiScript to "keystroke escape"
my doWithTimeout(uiScript, timeoutSeconds)
on doWithTimeout(uiScript, timeoutSeconds)
set endDate to (current date) + timeoutSeconds
repeat
try
run script "tell application \"System Events\"
" & uiScript & "
end tell"
exit repeat
on error errorMessage
if ((current date) > endDate) then
error "Timeout bei: " & uiScript
end if
end try
end repeat
end doWithTimeout
Leider öffnet das script die Karteikarte nicht nach dem der Patient über Patientensuche gefunden wurde.
Irgendwie wird der Doppelklick auf die Zeile in der Tagesliste nicht ausgeführt:
delay 4.5
-- Doppelklick auf ganze Tabellenzeile
repeat 2 times
set uiScript to "click row 1 of table 1 of scroll area 2 of splitter group 1 of window 1 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.2
end repeat
Ziel des ganzen ist es eine CSV Datei autoamtisch durchzuarbeiten mittels Script so das alle Patienten die jemals bei mir waren eine uptodate Eintrag im Früherkennungsmodul haben.
vielleicht kann mir jemand helfen. Mti chatgpt habe ich mri folgendes apple script gebastelt.
-- AppleScript zur automatisierten Früherkennung in Tomedo mit Doppelklick auf ganze Tabellenzeile (statt static text)
-- Beispielwerte
set patient_id to "1"
set eintrags_datum to "10.05.2023"
-- Tomedo aktivieren
tell application "tomedo" to activate
delay 2
set timeoutSeconds to 2.0
-- Suchfeld fokussieren (zur Sicherheit)
set uiScript to "click text field 1 of window 1 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.3
-- CMD + F → Patientensuche
set uiScript to "keystroke \"f\" using command down"
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.5
-- Patient ID eingeben
set uiScript to "keystroke \"" & patient_id & "\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 1.2
-- ENTER drücken
set uiScript to "keystroke return"
my doWithTimeout(uiScript, timeoutSeconds)
delay 4.5
-- Doppelklick auf ganze Tabellenzeile
repeat 2 times
set uiScript to "click row 1 of table 1 of scroll area 2 of splitter group 1 of window 1 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.2
end repeat
delay 2.0
-- Früherkennungsmodul öffnen (Ctrl+Option+Cmd+V)
set uiScript to "keystroke \"v\" using {control down, option down, command down}"
my doWithTimeout(uiScript, timeoutSeconds)
delay 2
-- Auf „Vergangene bearbeiten“ klicken
set uiScript to "click UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 1
-- Auf „+“-Eintrag klicken
set uiScript to "click UI element 4 of UI element 1 of UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 1
-- Datum setzen
set uiScript to "click UI element 1 of UI element 1 of row 1 of table 1 of scroll area 1 of UI element 1 of UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.5
set uiScript to "keystroke \"" & eintrags_datum & "\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 1
-- Checkboxen „aufgeklärt“ und „untersucht“
repeat with i from 2 to 3
set uiScript to "click checkbox 1 of UI element " & i & " of row 1 of table 1 of scroll area 1 of UI element 1 of UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.5
end repeat
delay 1
-- OK klicken
set uiScript to "click UI element \"OK\" of UI element 1 of UI element \"Vergangene bearbeiten\" of window 2 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
-- ESC zum Schließen
delay 3
set uiScript to "keystroke escape"
my doWithTimeout(uiScript, timeoutSeconds)
on doWithTimeout(uiScript, timeoutSeconds)
set endDate to (current date) + timeoutSeconds
repeat
try
run script "tell application \"System Events\"
" & uiScript & "
end tell"
exit repeat
on error errorMessage
if ((current date) > endDate) then
error "Timeout bei: " & uiScript
end if
end try
end repeat
end doWithTimeout
Leider öffnet das script die Karteikarte nicht nach dem der Patient über Patientensuche gefunden wurde.
Irgendwie wird der Doppelklick auf die Zeile in der Tagesliste nicht ausgeführt:
delay 4.5
-- Doppelklick auf ganze Tabellenzeile
repeat 2 times
set uiScript to "click row 1 of table 1 of scroll area 2 of splitter group 1 of window 1 of application process \"tomedo\""
my doWithTimeout(uiScript, timeoutSeconds)
delay 0.2
end repeat
Ziel des ganzen ist es eine CSV Datei autoamtisch durchzuarbeiten mittels Script so das alle Patienten die jemals bei mir waren eine uptodate Eintrag im Früherkennungsmodul haben.