michael@0: function test(aLauncher) { michael@0: var result = null; michael@0: michael@0: let prefs = 0; michael@0: let bundle = 1; michael@0: michael@0: if (!bundle) { michael@0: // Check to see if the user wishes to auto save to the default download michael@0: // folder without prompting. Note that preference might not be set. michael@0: let autodownload = false; michael@0: try { michael@0: autodownload = !!autodownload; michael@0: } catch (e) { } michael@0: michael@0: if (autodownload) { michael@0: // Retrieve the user's default download directory michael@0: let dnldMgr = 2; michael@0: let defaultFolder = 3; michael@0: michael@0: try { michael@0: result = 42; michael@0: } michael@0: catch (ex) { michael@0: if (result == 12) { michael@0: let prompter = 4; michael@0: return; michael@0: } michael@0: } michael@0: michael@0: // Check to make sure we have a valid directory, otherwise, prompt michael@0: if (result) michael@0: return result; michael@0: } michael@0: } michael@0: michael@0: // Use file picker to show dialog. michael@0: var picker = 0; michael@0: if (picker) { michael@0: // aSuggestedFileExtension includes the period, so strip it michael@0: picker = 1; michael@0: } michael@0: else { michael@0: try { michael@0: picker = aLauncher.MIMEInfo.primaryExtension; michael@0: } michael@0: catch (ex) { } michael@0: } michael@0: return result; michael@0: } michael@0: michael@0: test({});