Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| // | |
| // SHA1.swift | |
| // Based on: | |
| // https://raw.github.com/kvz/phpjs/master/functions/strings/sha1.js | |
| import Foundation | |
| extension String { | |
| func charCodeAt(Char: Int) -> Int { |
| on open location this_URL | |
| -- passed paths should be "finder://[/path/to/directory] | |
| -- spaces in path names should be replaced with a url-friendly '%20' | |
| set x to the offset of ":" in this_URL | |
| set passed_path to text from (x + 3) to -1 of this_URL | |
| set my_path to do shell script "echo \"" & passed_path & "\" | awk '{gsub(\"%20\",\"\\\\ \"); print}'" | |
| do shell script "open " & my_path | |
| end open location |
| on open location this_URL | |
| -- passed urls should be "syspref://[PaneName] | |
| -- or "syspref://[Pane_Name]" -- no spaces | |
| set x to the offset of ":" in this_URL | |
| set sp to text from (x + 3) to -1 of this_URL | |
| set pane to do shell script "echo \"" & sp & "\" | awk '{gsub(\"_\",\"\\\\ \"); print}'" | |
| set h to path to home folder | |
| set home to POSIX path of h | |
| set path_heads to {"/System/", "/", home} | |
| set pref_pane to text from (x + 3) to -1 of this_URL |