shell problem with osascript multiline
Hi.
I want to make automatic calls thanks to Skype.
my script works in terminal (leopard 10.5) but in the shell object, it doesn't (aka.shell same thing).
Here's my patch:
Thx All.
Ad.
You need to escape all the "quotes" with a backslash and make sure that you have the "quotes" and 'single quotes' in the right order:
osascript -e 'tell application "Skype"' -e 'send command "call ant" script name "whatever"' -e 'end tell'
I've made a simple parser which will allow you to type code into [textedit] as if you were using the Script Editor application and connect it to [shell]. If you think you'd find it useful let me know and I'll share it here.
lh
Thank you camarade !!!
Is this beaucause of max ? I've already seen this symbol: "|". do you have any idea of what it refers to ?
Yeah I am pretty curious about what you did to connect texteditor and the shell object !
Ad.
Yes it's just part of max you have to work with. Max reserves "quotes" to define symbols, so if you want a real one you have to escape it. The same goes for things like ;semicolons; in message boxes. I think the pipe symbol method you are referring to is a patch which uses other, non-reserved characters and then substitutes them afterwards using [spell] or something similar. My way is a piece of javascript which does all the formatting for you. Here it is, simply connect it between [textedit] and [shell] and you should be up and running.
lh
// lh.applescript.js
function text(all) {
var mem = all.split("n");
var themess = ["osascript"];
for (var i=0; i
Nice one !!
Thx You.
Ad.
I also working with apsct
need a hand with this ( would like tomake all one message) but does not work
osascript -e 'tell application "iTunes" to play next track' -e ' delay 60' -e 'tell application "iTunes" to play pause' -e 'end tell'
apple script is
tell application "iTunes"
set shuffle of user playlist "Music" to true
end tell
tell application "iTunes"
play (next track)
delay 60
tell application "iTunes" to pause
end tell
tell application "System Events"
set visible of process ("iTunes") to false
end tell
Luke,
I think some brackets are missing in your JS code. Not sure if the new forum design changed that maybe...
// lh.applescript.js
function text(all) {
var mem = all.split("n");
var themess = ["osascript"];
for (var i=0; i
Hey, could someone compile me this applescript for use with the shell object?
tell application "Ableton Live 9 Suite"
activate
tell application "System Events"
tell process "Live"
click menu item "Zoom In" of menu "View" of menu bar 1
end tell
end tell
end tell
I really dont understand much about java, so dont know how to run this compiler and I just need this bit of code. would be really thankful.
Jo
For those looking, here is the entire JS function/code from Luke. (It still doesn't work for me, but there may be some who would find it useful)
Note your JS object must be connected to a [textedit] (hence the function 'text' in line 1)
// lh.applescript.js
function text(all) {
var mem = all.split("\n");
var themess = ["osascript"];
for (var i=0; i<mem.length; i++) {
var temp = mem[i].replace(/^\ +/,"").split(" ");
for(var j=0; j<temp.length; j++) {
if (temp.length == 1) {
themess.push("-e","\'"+temp[j]+"\'");
} else if (j==0) {
themess.push("-e","\'"+temp[j]);
} else if (j==temp.length-1) {
themess.push(temp[j]+"\'");
} else {
themess.push(temp[j]);
}
}
}
outlet(0,themess);
}
function anything() {
post("lh.applescript.js: doesn't understand \""+messagename+"\"\n");
}
autowatch = 1;
// EOF