-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_store.rb
48 lines (48 loc) · 1.42 KB
/
app_store.rb
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
# dep 'App Store signed in' do
# met? { !(`/usr/bin/defaults read com.apple.storeagent AppleID`.include? 'does not exist') }
# meet {
# script = %{tell application "App Store" to activate
# tell application "System Events"
# tell process "App Store"
# tell menu bar 1
# tell menu bar item "Store"
# tell menu "Store"
# click menu item "Sign In…"
# end tell
# end tell
# end tell
#
# delay 1
# keystroke "[email protected] password"
#
# tell sheet 1 of window 1
# click button "Sign In"
# end tell
# end tell
# end tell}
# `osascript -e '#{script}'`
# }
# end
#
# dep 'Pages.app' do
# met? { File.exist? '/Application/Pages.app' }
# meet {
# script = %{
# tell application "App Store" to activate
# tell application "System Events"
# tell process "App Store"
# tell group 7 of tool bar 1 of window "App Store"
# set focused of text field 1 to true
# keystroke "Pages"
# keystroke return
# end tell
#
# delay 5
# tell group 1 of group 4 of list 1 of group 2 of UI element 1 of scroll area 1 of window "App Store"
# click button "InstallInstall"
# end tell
# end tell
# end tell}
# `osascript -e '#{script}'`
# }
# end