• 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
do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

do shell script


  • Subject: do shell script
  • From: Ian Mcginley - Systems Support Engineer <email@hidden>
  • Date: Tue, 21 Oct 2003 09:04:32 +1000

Hi All,

I've got an interesting problem with a do shell script:

Using project builder/interface builder to create my application i've got Applescript running doing all the textfield stuff, and that works a treat. But when it comes time to do the "do shell script" part it cannot find the shell script in question (well it can when executed within PB, but can't when run from the Applications directory).

The Code segment looks like this:

do shell script "./MyProggy.app/Contents/Resources/jstart.bash"

When I run the application (MyProggy.app) from /Applications and I click on my ok button I get the error:

AppleScript Error
sh: ./MyProggy.app/Contents/Resources/jstart.bash:
No such file or directory (127)

Now its interesting that the application runs fine in Project Builder when I click "Build and Run", but if I copy the application out of the build directory and into Applications, it doesn't work.

My dilemia is this, Apple's tech note 2065 says that you should include the full path to the scripts you want to run. So my issue now is, i've got this application which has the script inside it so I don't need to bundle the applescript and shell script seperately. Is there a way I can test for what directory my Application is running from with Applescript? I haven't been able to find an example of that one. Or does anyone else know of a work around apart from hard coding the location to /Applications/MyProggy.app/Contents/Resources/jstart.bash

Any and all help is appreciated.

--
Ian McGinley
Systems Support Engineer Sun Microsystems Australia
476 St Kilda Road - Melbourne - Australia - 3004
Ph: (03) 8866 6360 Email: email@hidden

UNIX is user-friendly, it is just picky about its friends
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: do shell script
      • From: Walter Ian Kaye <email@hidden>
  • Prev by Date: Re: Get IP Address
  • Next by Date: Re: Scripting CLI apps
  • Previous by thread: Re: Get IP Address
  • Next by thread: Re: do shell script
  • Index(es):
    • Date
    • Thread