I need to ba able to run osascript on a netboot volume which has a minimalistic OS X (DeployStudio NetBoot-set). But apart from the osascript binary itself, which files do I need to add to the NetBoot image to be able to do “display dialog”?
I’ve tried adding the files I thought were needed, but no luck. And google doesn’t give me any answers either. The only thing I can find is on DeployStudio’s own forum that “you need to add AppleScript files to the netboot image” but nothing on which these files are. And I also found a python script that can display a dialog, but I don’t do python.
I’m not sure what you mean by minimalistic but AppleScript isn’t a process like Finder than can be simply turned on and off. Also OSAScript (The command line utility) can’t do a display dialog because of the differences between an process and an application. So what you’ll need to do to display a dialog from the command line you’ll need to tell an existing application (you’re not an application but a process) to display the dialog for you like the Finder
tell application 'Finder" to display dialog "hello world!"
Ok, so I’ll try to explain more deeply…
DeployStudio NetBoot sets are a stripped down OS X, without for example Finder. I have now copied the following files to the NetBoot set:
Finder.app
System Events.app
AppleScript.framework
AppleScript.component
AppleScript Runner.app
osascript
osalang
osacompile
osadecompile
And what I have found, you have to tell System Events to display dialog, otherwise it doesn’t permit you to do user interactions from the Terminal (osascript).
When I try to run a simple applescript with osascript on the NetBoot set, I always get the same error: “Expected end of line but found identifier. (-2741)”
The script is confirmed working on a “regular” startup volume with the same OS version.
So there are something missing, but I hace no clue what!
I’ve no idea if your set-up will work or not, but the obvious omission is /System/Library/ScriptingAdditions/StandardAdditions.osax, which supplies the ‘display dialog’ command.
Thanks!
Added that and some other files, and now I get “execution error: An error of type -10810 has occured. (-10810)”
Update: I get the same error if I try “open “/System/Library/CoreServices/System Events.app””
So now I don’t think it’s an AppleScript/osascript error, rather a general system error…