120 questions
0
votes
0
answers
103
views
NSSavePanel ignores setDirectoryURL: on macOS Sequoia (15), always opens at last-used location
I have code in my macOS app that shows a save dialog using NSSavePanel.
I want the panel to always open in a specific directory that I send as a parameter to my function. (e.g., /User/Desktop).
Here’s ...
0
votes
1
answer
56
views
How to trigger default save action on NSSavePanel with accessoryView
Due to a bug on macOS Sonoma I am looking for a workaround to trigger default action of NSSavePanel in a sandboxed app.
The issue is that the NSSavePanel's accessorryView view doesn't react to enter ...
0
votes
0
answers
47
views
How to remove escaped characters from a path returned by NSSavePanel::url::path?
I'm using the following to let a user pick a file to save in my macOS app:
let panel = NSSavePanel()
let resp = panel.runModal()
if(resp == .OK)
{
let strFilePath = panel.url?.path();
}
The ...
2
votes
0
answers
37
views
Xamarin.Mac NSSavePanel() does not show up and returns "-2" when passing the file access security policy in sandbox in Xcode 14.2
This problem did not happen before macOS Ventura(Xcode 14.2), but I think the process of handling the security policy to Sandbox file access has changed significantly since this current version.
I ...
0
votes
0
answers
97
views
Trying to save a .txt file not working as I would expect
I have a function that uses an NSSavePanel to get a URL to save a text file report.
I'm trying to check to see if the resulting url ends in ".txt" and if it does, great. If it doesn't I am ...
0
votes
1
answer
573
views
NSDocument-Based Application: Selecting Default File Type in NSSavePanel
I'm playing with the NSDocument class to make a simple document-based application. My info.plist contains four document content type identifiers including public.text, public.plain-text, public....
1
vote
0
answers
153
views
Is it possible to create an NSSavePanel like the standard "keep this new document" dialog?
In an application like TextEdit, if the user attempts to close a new document, a special NSSavePanel is displayed.
Is there any way that I can create an NSSavePanel that resembles this dialog? The ...
0
votes
0
answers
414
views
NSSavePanel initialization throws Thread 1: EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0) on
I'm working on a flutter package for all 6 Platforms and now I'd like to open a Save As dialog (I'm total amateur in Swift), so I'm getting an exception when Initializing the object of NSSavePanel, I ...
0
votes
1
answer
1k
views
NSSavePanel getting warning: "please start panels using NSSavePanel rather than NSApplication or NSWindow"
Running in macOS 10.15.6, built with Xcode 11.1, my app is suddenly (at least I just noticed) spitting out these warnings on the console when I present a save dialog:
WARNING: <NSSavePanel: ...
0
votes
0
answers
161
views
NSSavePanel selects both filename and extension in Catalina
I always run macOS with the Finder options set to show extensions. I have some code that opens an NSSavePanel. In macOS versions before Catalina, it opened with only the filename selected and not the ...
0
votes
0
answers
69
views
How can I make NSSavePanel use the system's language?
I have a Java application on macOS that uses SWT. Sometimes this application needs to ask for a filename. Now, while SWT has a file dialog, this is sort of broken in recent versions.
So I made my own ...
2
votes
2
answers
864
views
Using Cocoa NSSavePanel in non-Sandboxed causes Assertion failure
Only in MacOS 10.15, only when trying to save a file twice to the same directory, and only after opening a NSOpenPanel then tap Cancel or Open. My app hangs up with the following stacktrace and the ...
1
vote
1
answer
536
views
NSSavePannel - how to restrict user to only save one one set directory?
User has to save a file, but I only want them saving the file in one folder. How to do this?
I have already tried implementing the delegate and forcefully setting back the directory if it is ...
0
votes
0
answers
349
views
NSOpenPanel and NSSavePanel localization
I use non English (Czech) UI of macOS Mojave and XCode 10.0 where I want to use NSOpenPanel and NSSavelPanel in my Swift 4.2 application. Some text items used in panels I can localize via NSOpenPanel/...
0
votes
0
answers
118
views
Show Mac devices in NSOpenPanel/NSSavePanel
For a given NSOpenPanel or NSSavePanel you can set a directory to show with:
[panel setDirectoryURL:[NSURL fileURLWithPath:@"/SomeFolder"]];
There you can set whatever path you like, but how can you ...
2
votes
0
answers
469
views
Saving a File With SavePanel with Custom UTI
I often create my own document type for my desktop applications. But I have never registered my own custom UTI. Anyway, I want to save a simple Dictionary data as a data (NSData) file like the ...
4
votes
1
answer
5k
views
macOS - How to have NSSavePanel to add a file extension in the file name?
I'm using this code to give the user the choice to specify a name and a location where to save a plain text file on disk. All seems to work but the saved file hasn't any extension. Actually I have not ...
0
votes
1
answer
427
views
NSSavePanel accessoryView: Why doesn't my button appear?
I am creating a save panel with an accessoryView that contains a single checkbox. I can get it to work when I create the button using:
NSButton(checkboxWithTitle: "Check Me", target: self, action: #...
1
vote
1
answer
74
views
macOS AppKit: Strange dragging behavior of modeless NSSavePanel
When I create a NSSavePanel to be modeless, the dragging behavior is very strange:
It does not react to dragging attempts in the title bar
When I initiate the drag in other areas of the panel, it will ...
4
votes
1
answer
3k
views
Save/Copy a file from Bundle to Desktop using NSSavePanel
I’m creating a macOS app which ships with some .zip files within its Bundle directory.
Users should be able to save these files from my app to a custom directory.
I found NSSavePanel and thought ...
0
votes
1
answer
653
views
Save file but hide file extension - Cocoa with Key Value Coding
I'm saving some objects to a file using Key Value Coding. I'd like the extension of the saved file to be hidden (or at least be hidden unless the value in Finder → Preferences → Advanced "Show All ...
2
votes
0
answers
347
views
How to change/suppress the file already exists message in NSSavePanel?
I use an NSSavePanel to ask users to indicate the file to which they want to save some information. If they choose an existing file I'd simply append the new information to the end. The issue is that ...
0
votes
1
answer
481
views
How to ask folder permission in Sandbox in OS X like this window?
When it needs folder permission in Sandbox, The Unarchiver will show a window like below.
I can ask permission myself using NSSavePanel, but there is an extra file name text field. If I try ...
2
votes
0
answers
382
views
NSSavePanel crash on El Capitan
I am using NSSavePanel and adding an Accessory View onto it using IKSaveOptions.
Pre-Yosemite it worked great and then Yosemite caused a crash as per: NSSavePanel crashes on Yosemite
I implemented ...
0
votes
0
answers
474
views
Opening NSSavePanel as sheet
I am using XCode7 beta2 to play around with Swift 2. Trying to use a File-Selection Dialog (NSSavePanel) brought me into some trouble.
Running the following code by clicking the associated button ...