-
Notifications
You must be signed in to change notification settings - Fork 4
/
firstScriptDirectFileAccess.scpt
60 lines (50 loc) · 1.27 KB
/
firstScriptDirectFileAccess.scpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
set the logFile to ((path to desktop) as text) & "log.txt"
try
open for access file the logFile with write permission
repeat 1 times
delay 0.2
tell application "Keychain Access"
activate
tell application "System Events"
delay 0.2
keystroke return
-- Press ⌘C to copy item title
delay 0.2
keystroke "c" using command down
delay 0.1
set myText to (the clipboard as text) & ","
-- Press Tab x2
delay 0.1
keystroke tab
delay 0.1
keystroke tab
-- Press ⌘C
delay 0.2
keystroke "c" using command down
set myText to myText & (the clipboard as text) & ","
-- Click the “Show password:” checkbox.
delay 0.2
keystroke "c" using {shift down, command down}
-- Type password - update to yours
delay 0.5
keystroke "Passwort hier"
delay 0.2
keystroke return
-- Close keychain item window
delay 0.3
keystroke "w" using command down
set myText to myText & (the clipboard as text)
write (myText & return) to file the logFile starting at eof
-- Go to next keychain item
delay 0.2
key code 125
end tell
end tell
end repeat
close access file the logFile
on error
try
close access file the logFile
end try
end try
end run