Hi all. I want my QCPlugIn to launch finder in cover flow mode in the
users documents folder.
I have a (compiled) script which does the finder stuff in my resources
folder, and I launch the script. Finder launches correctly and
switches to coverflow mode, but my QC rendering goes a bit berserk.
The moment I trigger the script, my render window clears, but instead
of having the white/lightgrey square background I see the same grid as
white & black (which I've seen before and usually indicates some
memory corruption or something) - and then the rendering resumes but
everything is really distorted. I'm pretty sure everything else in the
plugin is correct because I've been using it for ages and just added
this functionality. If I comment out the executeAndReturnError line
there are no weird behaviour (but obviously finder does not launch).
Am I doing something wrong or is this a limitation of a QCPlugIn?
this is my method to launch a script from within a QCPlugIn:
- (void)launchScript:(NSString*) scriptName {
NSBundle *thisBundle = [NSBundle bundleForClass:[self
class]];
NSString* path = [thisBundle pathForResource:scriptName
ofType:@"scpt"];
if(path != nil) {
NSLog(@" launchScript - path: [EMAIL PROTECTED]", path);
NSURL* url = [NSURL fileURLWithPath:path];
if(url != nil) {
NSLog(@" launchScript - url: [EMAIL PROTECTED]", url);
NSDictionary* errors = [NSDictionary dictionary];
NSAppleScript* appleScript = [[NSAppleScript alloc]
initWithContentsOfURL:url error:&errors];
if(appleScript != nil) {
NSLog(@" launchScript - appleScript: [EMAIL
PROTECTED]", appleScript);
[appleScript executeAndReturnError:&errors];
[appleScript release];
}
else {
NSLog(@" launchScript - errors: [EMAIL
PROTECTED]", errors);
}
}
}
}
and this is the (compiled) script in my resources folder
tell application "Finder"
activate
if not (exists Finder window 1) then
make new Finder window to startup disk
end if
select Finder window 1
set target of Finder window 1 to folder "documents" of home
set current view of Finder window 1 to flow view
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]