Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import headers or frameworks in scripts? #1

Open
mralexgray opened this issue Mar 1, 2013 · 2 comments
Open

import headers or frameworks in scripts? #1

mralexgray opened this issue Mar 1, 2013 · 2 comments

Comments

@mralexgray
Copy link

Would be possible to just write #import <SomeFWork/SomeFWork.h> within a script and have it actually work? Or possibly somewhere in the source files before the binaries compiled?

Brilliant piece of kit by the way. :-)

@mralexgray
Copy link
Author

Okay this is a pretty simple way of doing it…

//Load Custom Framework
NSString *frameworkName = @"AtoZ.framework";
NSString *frameworkPath = [[@"/Library/Frameworks" stringByAppendingPathComponent:frameworkName]stringByResolvingSymlinksInPath];//[[selfBundle bundlePath] stringByAppendingPathComponent:[@"Contents/Frameworks" 
NSLog(@"Framework %@ at %@", ([[NSFileManager defaultManager] fileExistsAtPath:frameworkPath]? @"EXISTS" : @"DOES NOT EXISTS"), frameworkPath);
if( [[NSBundle bundleWithPath:frameworkPath] load] ) {
    NSLog(@"Framework loaded...");
    NSLog(@"Framework provided classes such as DockTilePlugin (%@) and UndoManager (%@)", NSStringFromClass(NSClassFromString(@"DockTilePlugin")), NSStringFromClass(NSClassFromString(@"UndoManager")));
} else {
    NSLog(@"Error, framework failed to load.");
    exit(1);
}   

@Daij-Djan
Copy link
Owner

makes total sense Ill look into it this weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants