use following script as example:
do shell script "open -a Siri"
delay 1
tell application "System Events" to keystroke "${text_send_to_siri}"
tell application "System Events" to key code 36 -- Press Return keyDon't call Siri unless user ask to.
do shell script "cat << 'EOF' > ~/Desktop/script_file_name.sh
#!/bin/bash
# here is shell script content
EOF"
do shell script "chmod +x ~/Desktop/script_file_name.sh"- You always denote regular strings in JavaScript using double quotes "" or single quotes ''.
- Avoid using backticks `` to denote strings.
- Avoid using template literals or template strings like varName = `string text ${expression} string text`. Instead, use varName = 'text item delimiters' + expression + 'string text'.
- Do not use template literals or template strings like varName = `string text ${expression} string text`. Instead, use varName = 'text item delimiters' + expression + 'string text'.
- You escape quotes using backslash , like this: ".
you can use following command to query disk Total space and Free Space:
$ diskutil info / | grep 'Container Total Space'
$ diskutil info / | grep 'Container Free Space'example:
$ nohup the-command > /dev/null 2>&1 &