FROM : Vince DeMarco
DATE : Mon Jan 27 02:14:31 2003
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_removed>
> 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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Mon Jan 27 02:14:31 2003
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_removed>
> 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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Jeffrey Mattox | Jan 27, 02:04 | |
| Vince DeMarco | Jan 27, 02:14 |






Cocoa mail archive

