# FileBasedDocument::saveAsInteractiveAsync() not displaying system dialog

**URL:** <https://forum.juce.com/t/filebaseddocument-saveasinteractiveasync-not-displaying-system-dialog/57670>\
**Category:** General JUCE discussion\
**Created:** [August 31, 2023, 8:42pm UTC](https://forum.juce.com/t/filebaseddocument-saveasinteractiveasync-not-displaying-system-dialog/57670 "2023-08-31T20:42:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mattg/32/3867_2.png) [@mattg](https://forum.juce.com/u/mattg)\
**Post date:** [August 31, 2023, 8:42pm UTC](https://forum.juce.com/t/filebaseddocument-saveasinteractiveasync-not-displaying-system-dialog/57670/1 "2023-08-31T20:42:45Z")

</div>

FileBasedDocument::saveAsInteractiveAsync() is not displaying a dialog on macOS (haven’t tried Windows)  
JUCE version 7.0.7

In juce\_FileChooser\_mac.mm launch() line 189 ref is always nullptr

Invoking it like this `doc.saveAsInteractiveAsync(true, [](FileBasedDocument::SaveResult result) {});`

```c++
   void launch() override
    {
        if (panel != nil)
        {
            setAlwaysOnTop (WindowUtils::areThereAnyAlwaysOnTopWindows());
            addToDesktop (0);

            enterModalState (true);

            MessageManager::callAsync ([ref = SafePointer<Native> (this)]
            {
                if (ref == nullptr)
                    return;

                [ref->panel beginWithCompletionHandler: ^(NSInteger result)
                                                        {
                                                            if (auto* ptr = ref.getComponent())
                                                                ptr->finished (result);
                                                        }];

```

---

<div class="post-metadata">

**Author:** ![mattg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mattg/32/3867_2.png) [@mattg](https://forum.juce.com/u/mattg)\
**Post date:** [September 5, 2023, 2:35pm UTC](https://forum.juce.com/t/filebaseddocument-saveasinteractiveasync-not-displaying-system-dialog/57670/2 "2023-09-05T14:35:09Z")

</div>

Since I can’t delete this post the issue was that a few layers up the document was going out of scope in my app.
