• 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
Calling a script with Xcode 4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Calling a script with Xcode 4


  • Subject: Calling a script with Xcode 4
  • From: cptkrf <email@hidden>
  • Date: Wed, 05 Oct 2011 20:18:02 -0500

Greetings everyone.

I started learning Xcode a while ago and managed to bootstrap myself to a position to actually be able to write some code that works.  Xcode isn't exactly a beginner friendly suite, to say the least, but with some patience it can be learned.  Then I got a new Macbook and it came with Xcode 4 and replaced version 3 on my old machine.  I think it is better, but of course it was a huge change at the start of a learning curve that had barely started.

I do (did) most of my coding in Perl, and started using Xcode to replace the GUI Perl-Tk.  That lets me do stuff in Perl that I haven't learned yet to do in Objective C, but still display results in OSX's pretty GUI.   In Xcode 3, I would put the scripts and data in (jobfolder)/build/debug and call it, as with --- int result = system("./perlscript.pl");   Worked fine.

Along comes Xcode 4 and no build/debug folder.  The docs say that any file or resource is now to be placed in the Supporting Files folder and they will be found.  But, a bare call like the above doesn't find the script.  I have to hard code the path like --- int result = system("/Users/myself/Programming/CocoaLearn/perlscript.pl"); and it works fine, but hard coding paths in a program is a mess, of course.   If I hard code the path, it doesn't matter if I told the Supporting Files folder about it.

I have put the test script everywhere in the folder chain of the project, used the "Add files to project...", played with the Bundle path, used all the Unix precursors like ./  and ~ and so forth.  Either I am not finding the proper documentation, or am mis-reading it, or maybe just not seeing the forest for the trees.

Anybody?

Thanks.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Calling a script with Xcode 4
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Keyboard NSEvents and a NSObjectController?
  • Next by Date: [Moderator] Mourning the passing of Steve Jobs
  • Previous by thread: Re: Keyboard NSEvents and a NSObjectController?
  • Next by thread: Re: Calling a script with Xcode 4
  • Index(es):
    • Date
    • Thread