Importing desired text question.
I'm new to applescript and I was wondering if anyone had tips on how to fix this problem with this script I was working on.
If im trying to write a command into terminal it looks something like this.
________________________________________________________________________________ ____________________________________________________
activate application "Terminal"
tell "Terminal"
do script "sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText 'Text inserted here'"
end tell
________________________________________________________________________________ ____________________________________________________
But what I need to know how to do is something along the lines of this
________________________________________________________________________________ ____________________________________________________
set desiredtextQ to display dialog "Please enter your desired text." default answer "Text Here" buttons {"Continue", "Cancel"}
set desiredtextA to text returned of desiredtextQ
activate application "Terminal"
tell "Terminal"
do script "sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText 'desiredtextA'"
end tell
________________________________________________________________________________ ____________________________________________________
So basicly all I'm trying to do is take the text returned of a question and import it into a scripted terminal command.
I would be thankful if anyone had any help to share with me.
MacBook Pro (15-inch Late 2008), Mac OS X (10.7.4), AppleScript