1
我试图在Xcode中修改Quicksilverplugin(屏幕截图),以便将screencapture目标路径设置为默认值com.apple.screencapture路径值。由于某种原因,该插件目前具有硬编码路径,因此即使您更改了屏幕截图的OSX默认路径,该插件仍会将它们发送到OSX默认值,即桌面。OSX Quicksilver插件,Objective C指导
我是Xcode/Objective C的字面noob,所以任何信息/示例或点在正确的方向将非常感激。
这需要进行调整的抓屏插件文件是“QSScreenCapturePlugIn.m”文件 - 这里有一个片段:
(QSObject *)captureRegion:(QSObject *)dObject{
NSString *destinationPath=[@"~/Desktop/Picture.png" stringByStandardizingPath];
destinationPath=[destinationPath firstUnusedFilePath];
NSTask *task=[NSTask launchedTaskWithLaunchPath:SCTOOL arguments:[NSArray arrayWithObjects:@"-is",destinationPath,nil]];
[task waitUntilExit];
[[QSReg preferredCommandInterface] selectObject:[QSObject fileObjectWithPath:destinationPath]];
[[QSReg preferredCommandInterface] actionActivate:nil];
return nil;
}
我已经搜查高和低的例子演示了如何从默认数据库中读取,但似乎信息稀少。
谢谢!