본문 바로가기
#컴퓨터 과학 [Computer Science]/운영체제 (Operating System)

[OS - 🍎 macOS] macOS 앱 실행하기 (Launching apps programmatically)

by cy_mos 2019. 11. 1.
반응형

👓 001. launchApplication

// MARK: - Launches the specified app.

func launchApplication(_ appName: String) -> Bool

📔 Launching apps programmatically Source Code by Swift

NSWorkspace.shared.launchApplication('APP NAME')

// EXAMPLE
NSWorkspace.shared.launchApplication("Safari")

🚀 REFERENCE

 

ChangYeop-Yang/Study-macOS

macOS는 기업 애플이 제작한 운영 체제이다. 2002년 4월부터 모든 매킨토시 컴퓨터에 적용되고 있다. - ChangYeop-Yang/Study-macOS

github.com

 

launchApplication(_:) - NSWorkspace | Apple Developer Documentation

Instance Method launchApplication(_:) Launches the specified app. Declarationfunc launchApplication(_ appName: String) -> Bool ParametersappNameThe name of the app to open.Return Valuetrue if the app was successfully launched or was already running; otherw

developer.apple.com

 

반응형

댓글