Firefox: Can't "Open this Scriplet in your Editor"

This is not really an AS post, but I’m not sure where else I can post this.

Here’s the deal:

  1. I use Firefox
  2. The first time I visited Macscripter and clicked “Open this Scriplet in your Editor” Firefox warned me that a website was attempting to open an application on my computer (Script Editor).
  3. The warning box was so long that I couldn’t see any buttons, (Ignore or Cancel or OK)
  4. I tried moving the box around see the buttons to no avail
  5. I inadvertently pressed “Enter” which was the default choice for ignore/remember this forever/screw up slimjim’s workflow

Now “Open this Scriplet in your Editor” never works for me. Is there anywhere in Firefox 1.5 preferences that I can changes this? I guess it’s not considered a Pop-up, because I added macscripter.net to my Content>Allowed Sites and it still doesn’t work. Do I have to reinstall Firefox?
HELP!:o
slimjim5811

You’re not the first to do that! :slight_smile:
Do a search of the BB for “Firefox config”.

digest4d -
Thanks for your help! It took me a while to figure out where about:config was located. I was searching my hard drive.
For anyone as dumb as me, just type about:config into your Firefox URL bar.

Thanks again!
slimjim5811

Greetings, folks!

I know this has been asked, but for years I have never found an answer:

When I click on the “Open this Scriplet in your Editor” in Firefox, all I get in any script editor is a line of raw text. How can I configure Firefox to handle this such that even just line feeds come through? The posted suggestions regarding about:config have not worked for me.

It would be appreciated if a sticky could be posted with the info.

Thanks!

Model: 2.33 GHz MBPC2D
Browser: Firefox 3.5.3
Operating System: Mac OS X (10.6)

I can’t get “Open this Scriplet in your Editor” to work right from Firefox 4.0.1, either.

Doing the:

network.protocol-handler.external.applescript
network.protocol-handler.warn-external.applescript

…in about:config (as described here) doesn’t make a difference.

Now what?

I don’t know if this helps, but if you go to the “Applications” pane in Firefox’s preferences, there may be an “applescript” entry in the “Content Type” column. If there is and you click it, a pop-up menu will appear next to it in the “Action” column which will allow you to change/set the script editor used or to restore the original “Ask” dialog.

Thanks for the reply, Nigel, but what you’re talking about seems to control which app handles the text content of the “Open this Scriplet in your Editor” action. I believe mine is set properly ” it sends it to:

/Applications/AppleScript/Script Editor.app

…which accounts for the AppleScript code duly arriving in my Script Editor, but what my problem is, is the same one as livelife described in his post above, namely:

“When I click on the “Open this Scriplet in your Editor” in Firefox, all I get in any script editor is a line of raw text. How can I configure Firefox to handle this such that even just line feeds come through? The posted suggestions regarding about:config have not worked for me.”

So the AppleScript code arrives in my Script Editor, but it’s all one line without the line breaks necessary to let it compile. It’s easier to just copy & paste the code from the MacScripter webpage post and it will compile just fine because the line breaks are correct.

When I follow the suggestions in the other thread I linked to in my first post, to wit, in Firefox’s about:config…

network.protocol-handler.external.applescript | boolean | true
network.protocol-handler.warn-external.applescript | boolean | false

…it doesn’t help. So I guess what I’m asking is, is there anyone reading this who uses Firefox, actually once experienced this problem, and found a solution? If so, please tell us what you did to fix it. It looks like carriage return characters aren’t being passed to one’s script editor.

Sorry my reply didn’t help. I don’t know what’s causing your problem. Although I mainly use Safari, I have Firefox 3.6.27 on one machine and Firefox 13.0.1 on the other and they both open scripts correctly in repectively Script Editor and AppleScript Editor. I’ve never edited the config page as described in the other thread and there’s no mention of “applescript” in it now on either of my machines. So Firefox can pass the “applescript” protocol without unusual steps being required. There must be some corruption or setting which causes it to do so incorrectly on some systems.

Looking at a MacScripter.net thread-page source code, the scripts are in ecaped HTML form in the URLs embedded in the “Open this Scriplet in your Editor:” links and they contain linefeeds rather than returns:

<a href="applescript://com.apple.scripteditor?action=new&script=%0A%E2%80%A6%0Aset%20outputFile%20to%20%28%28path%20to%20desktop%20as%20text%29%20%26%20%22LaunchAgent_Alert.txt%22%29%20--%20represents%20%22MacHD%3AUsers%3Adavid%3ADesktop%3ALaunchAgent_Alert.txt%22%0Atry%0A%09set%20fileReference%20to%20open%20for%20access%20file%20outputFile%20with%20write%20permission%0A%09write%20theBody%20to%20fileReference%0A%09close%20access%20fileReference%0Aon%20error%0A%09try%0A%09%09close%20access%20file%20outputFile%0A%09end%20try%0Aend%20try%0A">Open this Scriplet in your Editor</a>

Good luck.

Thanks again for the follow-up investigation, Nigel. What’s happening in my Firefox is that ” whether linefeeds or returns ” they’re coming in as space characters.

It works fine in Safari for me, too, so on a hunch, I relaunched Firefox in “Safe Mode,” and guess what? It works! So I have a Firefox extension conflict. I owe it to everybody I’ve bothered here about this to track it down and report back my findings. Off to a “binary search” (disable half-at-a-time each launch), and I’ll be back this evening.

OK, I found the culprit: it’s the NoScript Firefox extension. But the curiosity is that it prevents a post’s AppleScript code from being passed properly to Script Editor even if I have NoScript whitelist MacScripter.net, or even configure it to allow absolutely everything! I have to disable NoScript completely in the Firefox Add-ons Manager and re-launch Firefox without it to get the Open this Scriplet in your Editor links to work correctly.

So I’ve opened an inquiry over on the NoScript forums, and I’ll report back here any solutions. Meanwhile, if you’re having the same problem, NoScript is the offending Firefox extension. (I think I’ll cross-post a link to this post in the other thread, too.)

Thanks, Schmye. That’ll undoubtedly be useful information for other users of this site.

Got the fix for Firefox users of the NoScript extention from one of the developers in this post.

“ Enter about:config in your Firefox address bar.
“ In the Filter search field, enter noscript.fixURI.exclude (it already got added to your Firefox user prefs when you first installed NoScript)
“ Double click the search result of that name (it should be the only hit) and enter applescript
“ You don’t need to re-launch Firefox; the fix takes effect immediately.

The about:config window will then look like this:

noscript.fixURI.exclude | user set | string | applescript

Voilá!