This commit is contained in:
2019-06-02 02:50:28 -07:00
parent 02d81ab872
commit fa79662a12
5 changed files with 47 additions and 6 deletions

View File

@@ -71,6 +71,10 @@ function alert($string, $title = "Warning") {
echo "\nALERT:".$title."|".$string."\n";
}
function notification($string) {
echo "\nNOTIFICATION:".$string."\n";
}
function askMulti($string, $buttons) {
$buttonstring = "buttons {\\\"".implode("\\\", \\\"",$buttons)."\\\"} default button ".count($buttons);
$result = exec("osascript -e \"display dialog \\\"".$string."\\\" ".$buttonstring."\" | cut -f2 -d':'");
@@ -155,10 +159,6 @@ function human_filesize($bytes, $decimals = 2) {
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor];
}
function ncenter($string, $title = "Skim") {
exec("osascript -e 'display notification \"".$string."\" with title \"".$title."\"'");
}
function utf8_for_xml($string) {
return preg_replace ('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $string);
}