Re: Getting the path to a resource (scpt)
Re: Getting the path to a resource (scpt)
- Subject: Re: Getting the path to a resource (scpt)
- From: Vince DeMarco <email@hidden>
- Date: Sun, 26 Jan 2003 17:14:31 -0800
On Sunday, January 26, 2003, at 05:04 PM, Jeffrey Mattox wrote:
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)"
NSBundle has this method
- (NSString *)pathForResource:(NSString *)name ofType:(NSString *)ext
inDirectory:(NSString *)subpath;
use "Scripts" for subpath
vince
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.
_______________________________________________
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.