A copy of an email from Chris Espinosa from Apple.
do shell script hints
A copy of an email from Chris Espinosa from Apple.
do shell script hints
See this script Terminal Window Here for a more detailed example of a Terminal.app AppleScript.
POSIX path or POSIX file
set f to choose file — f is a file object
set p to POSIX path of f — p is Unicode text of the path
set f1 to POSIX file p — f1 is a file object again
set qp to quoted form of p — qp is a path string you can send to Terminal even if it contains spaces or special characters
From Chris Nebel of Apple’s AppleScript Engineering group
ignoring application responses
tell application “loginwindow” to <
end ignoring
The double pointy brackets around the raw event call should be replaced by option-backslash and shift-option-backslash.The “rlgo” is short for “really log out”; if you want the “are you sure you want to log out” dialog, use aevtlogo instead. A future version of AppleScript will have a real command similar to “shut down”.
Extending BBEdit with Glossary Entries That Call AppleScripts
tell application "Terminal" do script with command "top -u -s10 10" set number of rows of window 1 to 18 set number of columns of window 1 to 80 set background color of window 1 to "black" set normal text color of window 1 to "yellow" set custom title of window 1 to "Top" set miniaturized of window 1 to true end tell