Objective
To troubleshoot and resolve script execution failures or syntax errors in Automox Worklets caused by "smart" or curly quotation marks (“”, ‘’) copied from external sources.
Overview
When copying PowerShell, Bash, or Shell scripts from external web pages, word processors (such as Microsoft Word), or rich-text documentation tools, standard straight quotation marks (" and ') are frequently auto-formatted into stylized "smart" or curly quotation marks (“” and ‘’).
Interpreters like PowerShell and Bash treat curly quotation marks as literal unicode characters rather than string delimiters. This results in broken string parsing, unexpected execution failures, or script syntax errors during Worklet execution.
Symptoms
Broken Syntax Highlighting: In the Automox Console code editor, string variables or file paths enclosed in quotation marks fail to change color (for example, failing to display as green string literals) and instead remain formatted as code syntax.
Script Execution Failures: Executing the Worklet returns syntax or parsing errors in the Activity Log, such as:
PowerShell:
Unexpected token in expression or statement.Bash/Zsh:
command not foundorsyntax error near unexpected token.
Visual Comparison
| Quotation Type | Visual Appearance | Interpreter Compatibility |
| Straight Quotes (Correct) | " or ' (Straight vertical ticks) | Valid. Properly delimits strings and variables. |
| Curly / Smart Quotes (Incorrect) | “ ” or ‘ ’ (Curved or slanted ticks) | Invalid. Causes string evaluation to fail. |
Resolution Steps
1.Identify Misformatted Quotation Marks:
Inspect the script in the Automox Console code editor. Look for string literals that lack proper syntax highlighting or feature curved quotation marks (“”).
2.Replace with Straight Quotation Marks:
Highlight and delete the curly quotation marks directly within the Automox script editor window, then retype them using your keyboard:
- Use
"(Shift +') for double quotes. - Use
'for single quotes.
3.Verify Syntax Highlighting & Test:
- Confirm that string literals and file paths now display with correct string syntax highlighting (color change).
- Click Save Policy and test script execution on a non-production endpoint.
Best Practices
Use Plain Text Editors: When drafting or editing Worklet scripts externally, use dedicated plain-text code editors (such as VS Code, Sublime Text, or Notepad++) rather than rich-text word processors.
Disable Smart Quotes in Communication Tools: If sharing scripts via documentation platforms or messaging apps, wrap code snippets in code fences (```) to prevent auto-formatting.