1 // Get lists from the "Tate Museum Artworks" table
2 var artTitleList = getColumn("Tate Museum Artworks", "Artwork Title");
3 var linkList = getColumn("Tate Museum Artworks", "Webpage");
4 var artistFirstNameList = getColumn("Tate Museum Artworks", "Artist First Name");
5 var artistLastNameList = getColumn("Tate Museum Artworks", "Artist Last Name");
6
7 // Set the dropdown menu options using the artwork title list
8 setProperty("artWorkTitle", "options", artTitleList);
9
10 // When user selects a title from the dropdown, update the info
11 onEvent("artWorkTitle", "change", function() {
12 var selectedTitle = getText("artWorkTitle");
13 updateArtworkInfo(selectedTitle);
14 });
15
16 // Function to show link and artist info for selected title
17 function updateArtworkInfo(title) {
18 for (var i = 0; i < [Link]; i++) {
19 if (artTitleList[i] === title) {
20 setText("output", linkList[i]);
21 setText("artistName", artistFirstNameList[i] + " " + artistLastNameList[i]);
22 return;
23 }
24 }
25
26 // If no match found
27 setText("output", "No link available");
28 setText("artistName", "Unknown artist");
29 }
30
31 // Switch to screen2 when start button is clicked
32 onEvent("startButton", "click", function() {
33 setScreen("screen2");
34 });
35
36 // Switch to screen1 when home button is clicked
37 onEvent("homeButton", "click", function() {
38 setScreen("screen1");
39 });
40
[Link] 4/7/25 上午 9 53
码 1/2
页
:
:
PDF document made with [Link]
[Link] 4/7/25 上午 9 53
码 2/2
页
:
: