Próbuję wyszukać wynik kodu AppleScript, aby ustalić, czy pojawi się ciąg.
Uruchamianie tego kodu:
tell application "System Events" to tell process "Box Sync" to ¬
tell menu bar item 1 of menu bar 2
click
get menu items of menu 1
set myStatus to menu items of menu 1
set myResult to result
return myResult
end tell
Prowadzi do:
{menu item "Files Synced" of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item 2 of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item "Pause" of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item 4 of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item "Open Box Sync Folder" of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item "Open Box.com" of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item 7 of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item "Preferences…" of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item 9 of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events", menu item "Quit" of menu 1 of menu bar item 1 of menu bar 2 of application process "Box Sync" of application "System Events"}
Teraz chciałbym przeszukać ten wynik, aby sprawdzić, czy „Synchronizacja plików” jest dostępna. Jednak działa
myResult contains "Files Synced"
Ponownie daje mi wydruk całego wyniku. Jak przeszukać ten wynik, aby ustalić, czy łańcuch jest obecny?