Difference between revisions of "Osascript"

From wikieduonline
Jump to navigation Jump to search
 
(36 intermediate revisions by 3 users not shown)
Line 1: Line 1:
* <code>osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title"'</code>
+
{{lowercase}}
* <code>osascript -e 'beep 1'</code> or <code>[[tput]] bel</code>
+
<code>[[osasscript]]</code> execute [[AppleScripts]] and other [[OSA]] language scripts
 +
* https://ss64.com/osx/osascript.html
  
 +
* <code>[[/usr/bin/]]osascript</code>
 +
 +
 +
== Examples ==
 +
echo "your text "| [[xargs -I]] {} [[osascript -e]] '[[display notification]] "{}" sound name "submarine" <ref>https://code-maven.com/display-notification-from-the-mac-command-line</ref>
 +
* <code>osascript -e 'display notification "MY TEXT"'</code>
 +
* <code>osascript -e 'display notification "MY TEXT" with title "MY TITLE"'</code>
 +
* <code>osascript -e 'display notification "My Notification text goes here" with title "My Title"'</code>
 +
* <code>osascript -e 'display notification "hello world!" with title "Greeting" subtitle "More text" sound name "Submarine"'</code>
 +
* <code>osascript -e 'display notification "hello world!" with title "Greeting" subtitle "More text" [[sound name]] "default"'</code>
 +
 +
* <code>osascript -e '[[beep]] 1'</code> or <code>[[tput]] bel</code> or <code>[[say]] TEST</code>
 +
 +
echo "your text "| [[xargs -I]] {} osascript -e 'display notification "{}" sound name "[[submarine]]"
 +
echo "your text "| [[xargs -I]] {} osascript -e 'display alert "{}"
 +
 +
osascript --help
 +
usage: osascript [-l language] [-e script] [-i] [-s {ehso}] [programfile] [argument ...]
 +
 +
/usr/bin/osascript -e '[[tell application "System Events" to set the autohide of the dock preferences to true]]'
 +
 +
display notification
 +
display alert
 +
 +
== Related ==
 +
* [[terminal-notifier]]
 +
* [[say]]
 +
* [[watch]]
  
 
== See also ==
 
== See also ==
 
* [[iTerm2]]
 
* [[iTerm2]]
 
* <code>[[tput]] bel</code>
 
* <code>[[tput]] bel</code>
 +
* [[growl]]
 +
* {{osascript}}
 +
* {{audio}}
 +
 +
 +
 +
[[Category:macOS]]

Latest revision as of 09:50, 4 February 2023

osasscript execute AppleScripts and other OSA language scripts


Examples[edit]

echo "your text "| xargs -I {} osascript -e 'display notification "{}" sound name "submarine" [1]
  • osascript -e 'display notification "MY TEXT"'
  • osascript -e 'display notification "MY TEXT" with title "MY TITLE"'
  • osascript -e 'display notification "My Notification text goes here" with title "My Title"'
  • osascript -e 'display notification "hello world!" with title "Greeting" subtitle "More text" sound name "Submarine"'
  • osascript -e 'display notification "hello world!" with title "Greeting" subtitle "More text" sound name "default"'
echo "your text "| xargs -I {} osascript -e 'display notification "{}" sound name "submarine"
echo "your text "| xargs -I {} osascript -e 'display alert "{}" 
osascript --help
usage: osascript [-l language] [-e script] [-i] [-s {ehso}] [programfile] [argument ...]
/usr/bin/osascript -e 'tell application "System Events" to set the autohide of the dock preferences to true'
display notification
display alert

Related[edit]

See also[edit]

  • https://code-maven.com/display-notification-from-the-mac-command-line
  • Advertising: