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;
}
我已經搜查高和低的例子演示瞭如何從默認數據庫中讀取,但似乎信息稀少。
謝謝!