• 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
Getting the path to a resource (scpt)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting the path to a resource (scpt)


  • Subject: Getting the path to a resource (scpt)
  • From: Jeffrey Mattox <email@hidden>
  • Date: Sun, 26 Jan 2003 19:04:56 -0600

I need to get the path to an AppleScript file ("FM.scpt") that is compiled as part of my AppleScript Studio project, but my code fails. I am doing this:

NSString *theCompiledScript;
theCompiledScript = [[NSBundle mainBundle]
pathForResource:@"FM" ofType:@"scpt"];
NSLog(@"%@\n",theCompiledScript); // fails: gives "(null)"

However, The file really is there at:

.../FM.app/Contents/Resources/Scripts/FM.scpt

As a test, I tried this and it returns the bundle's path:

NSLog(@"%@\n",[NSBundle mainBundle]);

That shows the full path to my app's bundle: "/blahblah.../FM.app"

What am I doing wrong when looking for the script file?

Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Getting the path to a resource (scpt)
      • From: Vince DeMarco <email@hidden>
  • Prev by Date: Re: Nib Corruption ("Inconsistencies"): Can This Nib Be Saved?
  • Next by Date: Re: Getting the path to a resource (scpt)
  • Previous by thread: stuffing characters
  • Next by thread: Re: Getting the path to a resource (scpt)
  • Index(es):
    • Date
    • Thread