- Registriert
- 02.04.16
- Beiträge
- 4
Hallo liebe Community,
ich versuche erstmalig mit dem Automator einen lästigen Arbeitsablauf loszuwerden. Mein Problem ist, dass beim aufzeichnen des Arbeitsablaufs nur immer genau derselbe Textinhalt des Textfeldes kopiert und wieder eingefügt wird und nicht variiert. Der Kunden heisst aber nicht immer "Max Mustermann"...
Es geht um eine Bearbeitung von Tickets in einem Webinterface, hier mal der Code:
Wäre toll, wenn das irgendwie ginge!
Danke und viele Grüße
Matz
ich versuche erstmalig mit dem Automator einen lästigen Arbeitsablauf loszuwerden. Mein Problem ist, dass beim aufzeichnen des Arbeitsablaufs nur immer genau derselbe Textinhalt des Textfeldes kopiert und wieder eingefügt wird und nicht variiert. Der Kunden heisst aber nicht immer "Max Mustermann"...
Es geht um eine Bearbeitung von Tickets in einem Webinterface, hier mal der Code:
Code:
_____________________________
on run {input, parameters}
--
delay 1.613532
set timeoutSeconds to 2.000000
set uiScript to "click UI Element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window \"OTRS :: Ticket :: Queue-Ansicht\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
--
delay 5.498363
set timeoutSeconds to 2.000000
set uiScript to "click group 18 of UI Element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window \"OTRS :: Ticket :: Queue-Ansicht\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
-- ⌘C drücken
delay 0.199749
set timeoutSeconds to 2.000000
set uiScript to "keystroke \"c\" using command down"
my doWithTimeout( uiScript, timeoutSeconds )
-- Auf die URL „Inhalt“ klicken.
delay 5.150694
set timeoutSeconds to 2.000000
set uiScript to "click static text 1 of UI Element \"Inhalt\" of group 10 of UI Element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window \"OTRS :: Ticket :: Queue-Ansicht\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
-- Auf die URL „Freie Felder“ klicken.
delay 2.194377
set timeoutSeconds to 2.000000
set uiScript to "click static text 1 of UI Element \"Freie Felder\" of group 5 of UI Element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window \"OTRS :: Ticket :: Inhalt :: 2016040210001109\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
-- Auf den Titel „<fill in title>“ klicken.
delay 2.912435
set timeoutSeconds to 2.000000
set uiScript to "click radio button 1 of tab group 1 of window \"OTRS :: Ticket :: Freie Felder :: 2016040210001109\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
-- Auf das Textfeld klicken.
delay 1.132129
set timeoutSeconds to 2.000000
set uiScript to "click text field 1 of group 2 of UI Element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window \"Subscriptions\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
-- ⌘V drücken
delay 1.112045
set timeoutSeconds to 2.000000
set uiScript to "keystroke \"v\" using command down"
my doWithTimeout( uiScript, timeoutSeconds )
-- „Max Mustermann" in das Textfeld eingeben.
delay 0.927076
set timeoutSeconds to 2.000000
set uiScript to "click text field 1 of group 2 of UI Element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window \"Subscriptions\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
-- Löschen drücken
delay 0.885039
set timeoutSeconds to 2.000000
set uiScript to "keystroke \"\" "
my doWithTimeout( uiScript, timeoutSeconds )
-- Typ 'Herr'
delay 0.504069
set timeoutSeconds to 2.000000
set uiScript to "keystroke \"Herr\""
my doWithTimeout( uiScript, timeoutSeconds )
-- „Herr Max Mustermann“ in das Textfeld eingeben.
delay 1.647039
set timeoutSeconds to 2.000000
set uiScript to "click text field 1 of group 2 of UI Element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window \"Subscriptions\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
-- ⌥X drücken
delay 0.456013
set timeoutSeconds to 2.000000
set uiScript to "keystroke \"≈\" using option down"
my doWithTimeout( uiScript, timeoutSeconds )
-- Löschen drücken
delay 2.864205
set timeoutSeconds to 2.000000
set uiScript to "keystroke \"\" "
my doWithTimeout( uiScript, timeoutSeconds )
return input
end run
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 "Can not " & uiScript
end if
end try
end repeat
end doWithTimeout
_______________________________________
Wäre toll, wenn das irgendwie ginge!
Danke und viele Grüße
Matz
Zuletzt bearbeitet von einem Moderator: