Difference between revisions of "Osascript"

From wikieduonline
Jump to navigation Jump to search
Line 4: Line 4:
  
 
== Examples ==
 
== Examples ==
  echo "your text "| xargs -I {} osascript -e 'display notification "{}" sound name "submarine"
+
  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"'</code>
 
* <code>osascript -e 'display notification "MY TEXT" with title "MY TITLE"'</code>
 
* <code>osascript -e 'display notification "MY TEXT" with title "MY TITLE"'</code>

Revision as of 09:49, 3 September 2022

osasscript execute AppleScripts and other OSA language scripts

Examples

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 ...]


display notification
display alert

Related

See also

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