[quote=242313:@Marco Hof]True, but now you mention it… for Shell I use NSTask (because supposedly Apps will be rejected when using the Xojo Shell).
But what about things like ShowURL and FolderItem.Launch? Do you know if those are those MAS friendly?
edit: I’m asking because I’m trying to stay as x-plat as possible and try to avoid using declares (and plug-ins) unless there’s really no other way.[/quote]
I have a couple apps in the MAS that rely on the Xojo shell , updated one recently and everything is just fine. At one point, there are urban legends about using the shell worth debunking. Pretty much the same for AppleScript. As long as you get the entitlement to script an app, you’re fine. The only things taboo are System Events and Desktop.
I also use ShowURL in every one of my apps, and FolderItem launch in a couple of them.
[quote=242376:@Michel Bujardet]I tried to launch a bash script but it was open as a text file, although all execution permissions are set and it works in Terminal.
The best I can think of is to use the same code as the interactive terminal example to provide, if not the ability to enter commands.
I believe, though, Marco’s Applescript solution is the best. It provides both the real terminal and scripting.[/quote]
The interactive terminal example is the first thing I tried, but, winexe don’t work on it.
Sorry, but I don’t know how to use Marco’s Applescript.
Dim sh As New Shell
sh.Execute("osascript -e 'tell application ""Terminal"" to do script ""winexe -u user%pass 192.168.2.42 cmd""'")
You can also write a little shell script. That’s a bit more of a hassle but probably easier if you need to do a whole lot of scripting and you prefer that above Applescript. I think Terminal only takes a shell script as argument. So if you write a little script like this:
#!/bin/bash
winexe -u user%pass 192.168.2.42 cmd
…and do: chmod +x script.sh
then you should be able to call is with:
open -b com.apple.terminal /path/script.sh
But in your case, I would use the call to osascript.
Dim sh As New Shell
sh.Execute("osascript -e 'tell application ""Terminal"" to do script ""winexe -u user%pass 192.168.2.42 cmd""'")
You can also write a little shell script. That’s a bit more of a hassle but probably easier if you need to do a whole lot of scripting and you prefer that above Applescript. I think Terminal only takes a shell script as argument. So if you write a little script like this:
#!/bin/bash
winexe -u user%pass 192.168.2.42 cmd
…and do: chmod +x script.sh
then you should be able to call is with:
open -b com.apple.terminal /path/script.sh
But in your case, I would use the call to osascript.[/quote]
Ok, work perfectly. Thanks.
But the terminal open in background. Is there any chance that Terminal open in front ?