Skip to main content

escape_for_applescript

Function escape_for_applescript 

Source
pub fn escape_for_applescript(s: &str) -> String
Expand description

Escape a string for safe embedding inside an AppleScript double-quoted string.

AppleScript requires that backslashes, double-quotes, and newlines are escaped. The order of replacements matters: backslashes must be escaped first so that the subsequent replacements do not accidentally double-escape them.