I'm trying to pass arguments from my php script to applescript like this;
function runAppleScript(){
exec("osascript processMail.scpt testing testing1");
}
and receive the first argument in applescript like this;
on run argv
set trimmedQuery to first item of argv
tell application "Fake"
activate
open "Macintosh HD:Users:mini:Documents:fake workflows:login.fakeworkflow"
delay 1
run workflow with variables {inputAddress:trimmedQuery}
wait until done
quit
end tell
end run
But the applescript isn't running. If I take out the run argv and setting the first item, the script runs properly. I'm not sure what I'm doing wrong!
exec(). 3. Have you tested your osascript command in Terminal as a normal user to make sure it works right there?