Create new file use NSSavePanel ?
liufsd opened this issue · comments
like this app https://langui.net/new-file-here
how to implement it ?
xpcConnection not working. do you know why ?
I think there is background application that open file dialog. and what do you mean "xpcConnection is not working"?
1.open dialog? The xpc can do it or not?do you have any idea about this?
2. I have try to write my project like your project,but the xpc not working. Maybe some config wrong.
DispatchQueue.main.async {
let panel = NSSavePanel()
panel.runModal()
}
log:
warning: <NSRemoteView: 0x6000001242e0> determined it was necessary to configure <NSVBSavePanel: 0x7fb5abd0e230> to support remote view vibrancy
Did you run DispatchQueue
in Cocoa app project?
run DispatchQueue in Cocoa app project ???
I mean, Did you call DispatchQueue funtion in xpc code or cocoa app code.
no i have just use this code in finderSync class
Then It is not work I heard that you can't use cocoa framework api's in FinderSync exntesions
I'm not sure. I don't know how to fix this warning log but the panel work…🙃
👍
@Luavis I hava trouble with XPC , if i submit my app to app store, i need to enable the XPC target sandbox ,but if i enable it ,if found that , the finderSync call XPC not working .such as open terminal not working. you can test it~ how to fix this ?
http://stackoverflow.com/questions/8871185/accessibility-api-stops-working-after-sandboxing
http://stackoverflow.com/questions/34119076/sandbox-entitlement-to-script-itunes-via-nsapplescript
http://stackoverflow.com/questions/38821844/xattr-command-not-working-inside-sandbox-app
Also not working, if you fix this, please tell me~ thanks.
fix it:
<key>com.apple.security.scripting-targets</key>
<dict>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.apple.terminal</string>
<string>com.googlecode.iterm2</string>
<string>com.apple.finder</string>
</array>
</dict>
<key>com.apple.security.temporary-exception.shared-preference.read-write</key>
<array>
<string>com.apple.finder</string>
</array>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.apple.terminal</string>
<string>com.googlecode.iterm2</string>
<string>com.apple.finder</string>
</array>
</dict>
Hi~ Apple do not allow do this ,if you try to submit to appstore~
It was written down in reference guide that If app allow FinderSync library access to /
no~ the apple not allow com.apple.security.temporary-exception.apple-events and com.apple.security.temporary-exception.apple-events