Skip to content

Commit 9359d97

Browse files
authored
Update automated-notebook-run-script.py
1 parent 9320705 commit 9359d97

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

scripts/automated-notebook-run-script.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,21 @@ def main():
191191
download_button,
192192
)
193193
applescript = '''
194-
tell application "System Events"
194+
tell application "System Events"
195195
tell process "Safari"
196-
delay 1
197-
click button "Allow" of window 1
196+
set buttonNames to {}
197+
-- Get all buttons in the first window
198+
repeat with aButton in (every button of window 1)
199+
set end of buttonNames to name of aButton
200+
end repeat
201+
-- Return the list of button names
202+
return buttonNames
198203
end tell
199-
end tell
200-
'''
201-
202-
subprocess.run(['osascript', '-e', applescript])
204+
end tell
205+
'''
206+
207+
result = subprocess.run(['osascript', '-e', applescript], capture_output=True, text=True)
208+
print(result.stdout)
203209
time.sleep(2)
204210

205211
# Close browser

0 commit comments

Comments
 (0)