Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

confusion

macrumors newbie
Original poster
Jul 15, 2003
11
0
Basel/Switzerland
hello everybody,

i have a java application, that should mount a smb-drive via applescript.

i use the following code:

Code:
...
StringBuffer script = new StringBuffer();
script.append("\'tell application \"Finder\" to mount volume \"smb:/");
script.append(ip);
script.append("/MyShare\"\'");
String[] cmd = {"osascript", "-e", script.toString()};
    try {
        Runtime rt = Runtime.getRuntime();
        Process proc = rt.exec(cmd);
...

but it doesn't work. an error is written to stderr

Code:
0:1: syntax error: A unknown token can't go here. (-2740)

if i print script and copy-paste it to the terminal it works as expected...

what am I doing wrong?

confusion
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.