fullPathForApplication:
アプリケーションのフルパスを返します
- (NSString *)fullPathForApplication:(NSString *)appName
func fullPathForApplication(_ appName: String) -> String?
解説
アプリケーション名(appName)のアプリケーションのフルパスを返します。
なければnilを返します。
返り値
フルパス
Objective-CNSString *String?
引数
アプリケーション名
Objective-C(NSString *)appName_ appName: String
フレームワーク
ApplicationKit
クラス
NSWorkspace
使用可能
10.0
参照
更新時のバージョン
OS X 10.10.3
Swift1.2
例文
#import "SetImage.h" @implementation SetImage - (IBAction)set:(id)sender { NSLog([[NSWorkspace sharedWorkspace] fullPathForApplication:@"QuickTime Player"]); } @end
//NSWorkspace fullPathForApplication @IBAction func function024(sender: AnyObject) { let theWorkspace : NSWorkspace = NSWorkspace.sharedWorkspace() let fullPath : NSString? = theWorkspace.fullPathForApplication("Safari") if (fullPath != nil) { NSLog("%@", fullPath!) } ///Applications/Safari.app }