AppleScript to add URL to Pi-hole whitelisting I'm writing a script to easily add sites to my Raspberry Pi's Pi-hole installation.
I've got the following:
tell application &quot;Terminal&quot;
    reopen
    activate
    do script &quot;ssh pi@192.168.*.*&quot; in window 1
    delay 0.2
    do script &quot;mypassword&quot; in window 1
    delay 0.4
    do script &quot;pihole -w *I need a display dialog where I can put an URL that returns to terminal   
    here* in window 1
    delay 0.2
    do script &quot;exit&quot; in window 1
end tell

I want to do this so I do not have to login to my Pi-hole site every other time to block or whitelist some sites.
Use the display dialog command’s optional default answer parameter to collect text

https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/PromptforText.html#//apple_ref/doc/uid/TP40016239-CH80-SW1
set input to display dialog &quot;Enter URL&quot; default answer &quot;&quot; with icon note buttons {&quot;Cancel&quot;, &quot;Continue&quot;} default button &quot;Continue&quot;
do script &quot;pihole -w &quot; &amp; (text returned of input) in window 1