Search Unity

How do I run this applescript with c#?

Discussion in 'Scripting' started by FarzanZand, Jun 21, 2016.

  1. FarzanZand

    FarzanZand

    Joined:
    Jul 29, 2013
    Posts:
    14
    Hello!
    I've been trying to get my unity app to communicate with applescript.
    This is the applescript command I want to run (just as a proof of concept to get core to work).

    tell application "Finder"

    display dialog "Hello World"

    end tell

    After googling around, I managed to come up with this which is placed in the Start() function.
    Code (CSharp):
    1. System.Diagnostics.Process.Start("osascript -e 'tell application \"Finder\"\ndisplay dialog \"Hello World\"\nend tell");
    But nothing happens! I've been going nuts trying to find a solution. Anybody out there that can help me? Would really assist me in getting the ball rolling.
     
  2. Zaflis

    Zaflis

    Joined:
    May 26, 2014
    Posts:
    438
    What if you replace all \n with space? It might be cutting the command on first line change.