> On Aug 11, 2016, at 5:20 PM, Gurkan Erdogdu <[email protected]> wrote:
> 
> Hi folks
> In my Swift application, I try to open a Word file with Microsoft Word 
> application via NSTask. Here is the code:
>                 let task = NSTask()
>                 task.launchPath = bundle!.executablePath
>                 task.arguments = ["file.docx"]
>                 task.launch()
>                 task.waitUntilExit()
> 
> But when word is launched, it popsup Grant Access dialog box. How can I 
> dismiss this dialog box and open the file directly?
> BestGurkan

Don’t use NSTask for that. Use -[NSWorkspace 
openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:].
 Don’t be daunted by the large number of arguments; the first two are the only 
ones you need to worry about.

Charles


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to