Thank you for your post!
I was unable to experience any additional dialog windows when running the following script:
Set Error Capture [ On ]
Set Variable [ $Path ; Get(DesktopPath) ]
Get Directory[ Allow Folder Creation ; $i ; "test" ; $path
When ran and clicking Cancel, it does return Error 1.
I added an IF line to check for Get(LastError) = "1" and it also seemed to work as expected. Do you have any further information we might use to reproduce?
I'm also going to move this thread from the FileMaker Community Feedback Space (which is specifically for input on the Community itself) to the Discussions Space where you should receive more views and potentially more feedback on this topic!
I also tried to use an IF statement after the Get Directory to put up a custom dialog box if the cancel button is clicked but it does not seem to capture. It otherwise works as needed for the moment. I am on FMP 14 Advanced, mac OS 10.12.5 if that makes a difference.
Actually this is a problem. As it does not capture with an IF statement it goes to my ELSE statement and prints the PDF in the same directory as the solution file. Not sure what else to try.
Filemaker Pro 14 Advanced 14.0.6.
Figured it out. I had a script step between the Get Directory and the IF statement and so the last error code was based on a script step that was in fact working.