AppleScript Tutorial : Repeat Loops

AppleScript Tutorial : Repeat Loops

ClickingKeys

2 года назад

3,058 Просмотров

Learn how to AppleScript, Apple's built in automation platform. In this video you'll learn how to use Apple’s free Script Editor application to write four different repeat loops as well as how to exit a repeat loop early if a condition has been met. Even if you're a complete noob, you'll be able to follow along with this video to increase your understanding and abilities to AppleScript.


-- -- -- -- -- -- -- START EXAMPLE SCRIPT CODE -- -- -- -- -- -- --
on run
# REPEAT LOOP EXAMPLES

# EXAMPLE 1
repeat 3 times
display dialog "Hello"
end repeat

# EXAMPLE 2
repeat with i from 1 to 3
display dialog (i as string)
if i = 2 then
exit repeat
end if
end repeat

# EXAMPLE 3
set myList to {"Buggz", "Joan", "Jack"}
repeat with anItem in myList
display dialog "Hello " & anItem as string
end repeat

# EXAMPLE 4
set test to true
set i to 1
repeat while test = true
display dialog "Hello"
if i ≥ 4 then
set test to false
end if
set i to i + 1
end repeat
end run
-- -- -- -- -- -- -- END EXAMPLE SCRIPT CODE -- -- -- -- -- -- --


For more AppleScripting tutorial videos, check out this play list.
https://youtube.com/playlist?list=PL5iB9WEZe2j04doUAKVxqxaCv3JJ8TxQr

If you're interested in watching full scripts being written, have a look at this play list.
https://youtube.com/playlist?list=PL5iB9WEZe2j2UIcvjAPVDNMU7oCuCb5eJ

Тэги:

#AppleScript #Tutorial #HowTo #How_To #Automate #Automation #Script #macOS #Help #Apple_Script #Command #Shell #repeat #for_loop #while_loop #repeat_loop #exit_repeat #example #examples #AppleScripting #Big_Sur #Monterey
Ссылки и html тэги не поддерживаются


Комментарии: