Basics of AppleScript

Merge Lists

Script [6.3.1]:

set laptop to {"MacBook Pro"}
set tablet to {"iPad"}
set phone to {"iPhone"}
set devices to laptop & tablet & phone
get devices

Explanation: The first three statements will create three lists named laptop, tablet and phone which will contain Macbook Pro, iPad and iPhone respectively. The fourth statement will create a list named devices which will merge the contents of laptop, tablet and phone. & is used to merge lists. It is the same symbol used to merge Strings. Finally the get command is used to print the devices list in result tab.

Figure 6.3.1

Figure 6.3.1 Merged Lists