AppleScript के साथ समस्या हो रही है


0

जब मैं चाहता हूं तो यह फेसटाइम लॉन्च नहीं कर रहा है! मैं चाहता हूं कि यह एक ऐप लॉन्च करे, और आपको यह चुनना है कि यह किस ऐप को लॉन्च करता है, इसलिए यदि मैं Google Chrome दबाता हूं, तो यह Google Chrome लॉन्च करता है, लेकिन यह फेसटाइम लॉन्च नहीं करता है।

set the_results to (display dialog "Please Choose User!" buttons {"Admin", "Guest", "Cancel"})
set button_returned to button returned of the_results
if button_returned is "Guest" then display dialog "Guest is not functioning!"
if button_returned is "Admin" then display dialog "Please insert password!" buttons {"Cancel", "Continue"} default button 2 default answer "" cancel button 1 with hidden answer
if the text returned of the result is "Test" then
    set the_results to (display dialog "Welcome! What would you like to do?" buttons {"Chrome", "Messages", "More"})
    set button_returned to button returned of the_results
    if button_returned is "Chrome" then tell application "Google Chrome"
        activate
    end tell
    if button_returned is "Messages" then tell application "Messages"
        activate
    end tell
    if button_returned is "More" then display dialog "Second Page" buttons {"FaceTime", "Thank You!"}
end if
if button_returned is "FaceTime" then tell application "FaceTime"
    activate
end tell

जवाबों:


1

यह आपके अंतिम प्रश्न के समान त्रुटि है :

आप बटन को फिर से उपयोग कर सकते हैं और the_results (जैसे आपने पहले ही लाइन 6 और 7 में किया था -> 1 और 2:

...
    if button_returned is "More" then set the_results to (display dialog "Second Page" buttons {"FaceTime", "Thank You!"})
    set button_returned to button returned of the_results
end if
if button_returned is "FaceTime" then tell application "FaceTime"
    activate
end tell

या दो नए चर पेश करें: button_returned2 और the_nextresults :

...
    if button_returned is "More" then set the_nextresults to (display dialog "Second Page" buttons {"FaceTime", "Thank You!"})
    set button_returned2 to button returned of the_nextresults
end if
if button_returned2 is "FaceTime" then tell application "FaceTime"
    activate
end tell
हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.