• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Apple script from a c file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple script from a c file


  • Subject: Re: Apple script from a c file
  • From: Markus Hitter <email@hidden>
  • Date: Thu, 15 Sep 2005 11:50:16 +0200


Am 15.09.2005 um 07:41 schrieb Shreyas Srinivasan:

My apple script looks like this

        tell application "Finder"
            launch application "X11"
        end tell

Any reason why you don't want to use NSWorkspace to launch the app directly?


        set results to do shell script "cd ~; DISPLAY=:0.0;
          export DISPLAY; PATH=$PATH:/usr/local/bin; export PATH ;
          /opt/gnome-2.12/bin/evolution-start.sh > /dev/null 2>&1 &"

A simple

system("cd ~; export DISPLAY=:0.0; export PATH=$PATH:/usr/local/ bin; /opt/gnome-2.12/bin/evolution-start.sh > /dev/null 2>&1 &");

in your C / Obj-C code should do as well. Take care for users using a different than the default "bash" shell. If you need more control, check popen(), exec() and NSTask.


I tried adding a main.scpt and removed the main.m

If you can get away without a main.m, a plain AppleScript, compiled as an app, should do the same. No Xcode needed.


If you still feel the need for an embedded AppleScript, there's the NSAppleScript class.


HTH, Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/




_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Apple script from a c file (From: Shreyas Srinivasan <email@hidden>)

  • Prev by Date: Apple script from a c file
  • Next by Date: Re: Data formatter for wstring
  • Previous by thread: Apple script from a c file
  • Next by thread: Re: Apple script from a c file
  • Index(es):
    • Date
    • Thread