Loading ...
Sorry, an error occurred while loading the content.
 

WP > web browser: doesn't work

Expand Messages
  • John R
    WordPerfect lets you format a string as a URL, appearing as a link in the text, so that you can click on it and go there in your browser. This required
    Message 1 of 14 , Apr 16, 2012
      WordPerfect lets you format a string as a URL, appearing as a link in the text, so that you can click on it and go there in your browser. This required identifying a browser on your machine, by going to Preferences > HTML > Choose Browser. The standard file dialog drills down through folders until it reaches the file -- the browser application -- that you want.

      OSX browsers tend to be packages, which pre-OSX systems and applications see as folders, so you can't use WP's means to identify a browser. OSX also doesn't require you to identify a browser; just use "open location" in Applescript.

      I'd like to see a small Applescript application that would substitute for a file-based web browser you could point WP to, and thereby restore the click-to-go functionality.

      Since what WP does when you click on a link, I understand, is send a Run event to whatever browser you've specified, along with the URL, an Applescript (saved as an application file) should look something like:

      on run (theURL)
      open location theURL
      end run

      --> error: some parameter is missing.

      When I try to do something else with the passed URL:

      on run (theURL)
      display dialog (theURL as string)
      end run

      --> the dialog shows this entire run handler, with "theURL" as written, not what was clicked on.

      Just the URL as string is what we actually need. With Sheepshaver, I'll just put the URL in a text file and copy that to a watched folder on the OSX side, where a folder action script will pick it up. I just can't seem to get ahold of that URL.

      Can anyone tell me what I'm doing wrong?

      Thanks,
      John R.
    • em315
      John, Can you clarify two things: 1. Are you already able to copy the http://etc.etc.etc to OS X as a text string in a text file? 2. Exactly what do you mean
      Message 2 of 14 , Apr 16, 2012
        John,

        Can you clarify two things:

        1. Are you already able to copy the http://etc.etc.etc to OS X as a text string in a text file?

        2. Exactly what do you mean by "I just can't seem to get ahold of that URL"? Do you mean: (a) you can't find a way (using AppleScript) to extract the URL string from the text file so that you can use the string as a variable in an AppleScript; or (b) you can successfully extract the string from the text file and set it as a variable in AppleScript but you can't get the AppleScript to open the URL in a browser; or (c) something else entirely?

        --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@...> wrote:
        >
        > WordPerfect lets you format a string as a URL, appearing as a link in the text, so that you can click on it and go there in your browser. This required identifying a browser on your machine, by going to Preferences > HTML > Choose Browser. The standard file dialog drills down through folders until it reaches the file -- the browser application -- that you want.
        >
        > OSX browsers tend to be packages, which pre-OSX systems and applications see as folders, so you can't use WP's means to identify a browser. OSX also doesn't require you to identify a browser; just use "open location" in Applescript.
        >
        > I'd like to see a small Applescript application that would substitute for a file-based web browser you could point WP to, and thereby restore the click-to-go functionality.
        >
        > Since what WP does when you click on a link, I understand, is send a Run event to whatever browser you've specified, along with the URL, an Applescript (saved as an application file) should look something like:
        >
        > on run (theURL)
        > open location theURL
        > end run
        >
        > --> error: some parameter is missing.
        >
        > When I try to do something else with the passed URL:
        >
        > on run (theURL)
        > display dialog (theURL as string)
        > end run
        >
        > --> the dialog shows this entire run handler, with "theURL" as written, not what was clicked on.
        >
        > Just the URL as string is what we actually need. With Sheepshaver, I'll just put the URL in a text file and copy that to a watched folder on the OSX side, where a folder action script will pick it up. I just can't seem to get ahold of that URL.
        >
        > Can anyone tell me what I'm doing wrong?
        >
        > Thanks,
        > John R.
        >
      • John R
        ... Not by clicking on the formatted link. You can of course select the URL, and use WP Applescript s contents of selection but this, and then choosing a
        Message 3 of 14 , Apr 16, 2012
          --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
          >
          > 1. Are you already able to copy the http://etc.etc.etc to OS X as a text string in a text file?

          Not by clicking on the formatted link. You can of course select the URL, and use WP Applescript's "contents of selection" but this, and then choosing a command from a menu, are additional steps I'd like to circumvent.

          > 2. Exactly what do you mean by "I just can't seem to get ahold of that URL"? Do you mean: (a) you can't find a way (using AppleScript) to extract the URL string from the text file so that you can use the string as a variable in an AppleScript; or (b) you can successfully extract the string from the text file and set it as a variable in AppleScript but you can't get the AppleScript to open the URL in a browser; or (c) something else entirely?

          Clicking on a link in WP sends a Run event to your application of choice, along with the URL. I can't figure out how to get the URL string from that event.

          Thanks,
          John R.
        • em315
          I m not sure this can be done in the way you want in AppleScript under pre-OS X. On run can t take a parameter. Is there any way to intercept the command
          Message 4 of 14 , Apr 16, 2012
            I'm not sure this can be done in the way you want in AppleScript under pre-OS X. "On run" can't take a parameter. Is there any way to intercept the command that WP sends? Can you see what it is? It might be an openURL command.

            --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@...> wrote:
            >
            >
            >
            > --- In wordperfectmac@yahoogroups.com, "em315" <em315@> wrote:
            > >
            > > 1. Are you already able to copy the http://etc.etc.etc to OS X as a text string in a text file?
            >
            > Not by clicking on the formatted link. You can of course select the URL, and use WP Applescript's "contents of selection" but this, and then choosing a command from a menu, are additional steps I'd like to circumvent.
            >
            > > 2. Exactly what do you mean by "I just can't seem to get ahold of that URL"? Do you mean: (a) you can't find a way (using AppleScript) to extract the URL string from the text file so that you can use the string as a variable in an AppleScript; or (b) you can successfully extract the string from the text file and set it as a variable in AppleScript but you can't get the AppleScript to open the URL in a browser; or (c) something else entirely?
            >
            > Clicking on a link in WP sends a Run event to your application of choice, along with the URL. I can't figure out how to get the URL string from that event.
            >
            > Thanks,
            > John R.
            >
          • John R
            What I m looking for is something like this sequence, when I run this script: run script (choose file) with parameters { Hello, World } and choose this script
            Message 5 of 14 , Apr 16, 2012
              What I"m looking for is something like this sequence, when I run this script:

              run script (choose file) with parameters {"Hello, World"}

              and choose this script file:

              on run {theURL}
              display dialog (theURL as string)
              end run

              The first script sends a run command to the second script. I have some vague notion that this is what WP does when we click on a link. Maybe not, or there's special syntax needed to capture the URL.

              WP does not send an Open event here; that can be shown by pointing WP's browser choice to:

              on run
              display dialog "run"
              end run

              on open
              display dialog "open"
              end open
            • Smokey Ardisson
              ... Like Ed said, I would have expected WP (and everything else of that era) to send the old Spyglass open url (WWW!OURL) event, or possibly the newer open
              Message 6 of 14 , Apr 17, 2012
                On Mon Apr 16, 2012 9:52 pm ((PDT)), "John R" <johnrethorst@...> wrote:

                >on run {theURL}
                > display dialog (theURL as string)
                >end run
                >
                >The first script sends a run command to the
                >second script. I have some vague notion that
                >this is what WP does when we click on a link.
                >Maybe not, or there's special syntax needed to
                >capture the URL.

                Like Ed said, I would have expected WP (and
                everything else of that era) to send the old
                Spyglass "open url" (WWW!OURL) event, or possibly
                the newer "open location". However, unless
                Classic AppleScript doesn't let you write
                handlers for random events like modern
                AppleScript does, that's not it...oh, hmm.

                OK.

                As near as I can tell with the crude debugging
                tools available (WP + Classic + Mac OS X dummy
                app + AEDebugReceives), what WP does is send
                WWW!CNCL followed by WWW!OURL. (WP doesn't
                actually send run; seeing the run handler execute
                is an artifact of the OS sending the oapp event
                to launch the app.)

                Unfortunately, it seems like when this event pair
                goes to an AppleScript application, the events
                are lost (perhaps waiting for the app to launch,
                since we're installing handlers only after the
                app is fully running?). This seems to be a
                limitation of the particular circumstances of
                event dispatch we're encountering here, since,
                e.g., a Mac OS X AppleScript app handling "open
                location" events from other Mac OS X apps works
                fine.

                However, you can work around this by making the
                app "Stay Open" and then launching it manually
                first (or, if you just make it "Stay Open", then
                the first click's URL gets lost, but any
                subsequent ones succeed). So your applet needs
                to be:

                on «event WWW!OURL» inURL
                --do stuff with inURL here
                end «event WWW!OURL»

                and saved as "Stay Open".

                Smokey
              • sardisson
                ... It later occurred to me that event dispatch might work differently in pure Mac OS inside SheepShaver than with Classic+Mac OS X, so you probably want to
                Message 7 of 14 , Apr 17, 2012
                  --- In wordperfectmac@yahoogroups.com, Smokey Ardisson wrote:
                  > Unfortunately, it seems like when this event pair
                  > goes to an AppleScript application, the events
                  > are lost (perhaps waiting for the app to launch,
                  > since we're installing handlers only after the
                  > app is fully running?). This seems to be a
                  > limitation of the particular circumstances of
                  > event dispatch we're encountering here, since,
                  > e.g., a Mac OS X AppleScript app handling "open
                  > location" events from other Mac OS X apps works
                  > fine.
                  >
                  > However, you can work around this by making the
                  > app "Stay Open" and then launching it manually
                  > first (or, if you just make it "Stay Open", then

                  It later occurred to me that event dispatch might work differently in "pure" Mac OS inside SheepShaver than with Classic+Mac OS X, so you probably want to double-check that the initial WWW!OURL still gets lost before doing "Stay Open". That said, I expect that the problem *will* still exist if I'm close to being right about its cause…

                  Smokey
                • em315
                  Smokey, Brilliant detective work!! Doesn t this suggest that it should be possible to take the routine that you described and add it to the script that s
                  Message 8 of 14 , Apr 17, 2012
                    Smokey,

                    Brilliant detective work!! Doesn't this suggest that it should be possible to take the routine that you described and add it to the script that's already running in the background in SheepShaver-WP?

                    --- In wordperfectmac@yahoogroups.com, Smokey Ardisson <smokey.ardisson@...> wrote:
                    > As near as I can tell with the crude debugging
                    > tools available (WP + Classic + Mac OS X dummy
                    > app + AEDebugReceives), what WP does is send
                    > WWW!CNCL followed by WWW!OURL. (WP doesn't
                    > actually send run; seeing the run handler execute
                    > is an artifact of the OS sending the oapp event
                    > to launch the app.)
                    >
                    > Unfortunately, it seems like when this event pair
                    > goes to an AppleScript application, the events
                    > are lost (perhaps waiting for the app to launch,
                    > since we're installing handlers only after the
                    > app is fully running?). This seems to be a
                    > limitation of the particular circumstances of
                    > event dispatch we're encountering here, since,
                    > e.g., a Mac OS X AppleScript app handling "open
                    > location" events from other Mac OS X apps works
                    > fine.
                    >
                    > However, you can work around this by making the
                    > app "Stay Open" and then launching it manually
                    > first (or, if you just make it "Stay Open", then
                    > the first click's URL gets lost, but any
                    > subsequent ones succeed). So your applet needs
                    > to be:
                    >
                    > on «event WWW!OURL» inURL
                    > --do stuff with inURL here
                    > end «event WWW!OURL»
                    >
                    > and saved as "Stay Open".
                  • John R
                    Works! Not only that, we already have a stay-open script running, to look for text files from Open WP Files , so I just have this handler write the URL to a
                    Message 9 of 14 , Apr 17, 2012
                      Works!

                      Not only that, we already have a stay-open script running, to look for text files from "Open WP Files", so I just have this handler write the URL to a text file and drop it in the watched folder on the OSX side, as I do with dictionary lookup entries. Runs like a charm.

                      _So_ cool! WP's integration with OSX is very nice to have.

                      Thanks so much, Smokey and Ed. This will be part of the next update to Sheepshaver-WordPerfect Install, which will also support the fine Nisus Thesaurus just as it now supports Apple's OSX Dictionary, and which will have a 1gb volume, and some other neat stuff.

                      I'll also work up a script for OSX Classic systems, so WP can send URLs to browsers that are packages rather than simple files, i.e. most or all of them.

                      Thanks again,
                      John R.


                      --- In wordperfectmac@yahoogroups.com, Smokey Ardisson <smokey.ardisson@...> wrote:

                      > on «event WWW!OURL» inURL
                      > --do stuff with inURL here
                      > end «event WWW!OURL»
                      >
                      > and saved as "Stay Open".
                      >
                      > Smokey
                      >
                    • John R
                      ... OS 10.4 running Classic needs a stay-open script. Sheepshaver does not. Interesting. ... everything else of that era) to send the old Spyglass open url
                      Message 10 of 14 , Apr 18, 2012
                        --- In wordperfectmac@yahoogroups.com, "sardisson" <smokey.ardisson@...> wrote:

                        > It later occurred to me that event dispatch might work differently in "pure" Mac OS inside SheepShaver than with Classic+Mac OS X, so you probably want to double-check that the initial WWW!OURL still gets lost before doing "Stay Open". That said, I expect that the problem *will* still exist if I'm close to being right about its cause…

                        OS 10.4 running Classic needs a stay-open script. Sheepshaver does not. Interesting.

                        >I would have expected WP (and
                        everything else of that era) to send the old
                        Spyglass "open url" (WWW!OURL) event

                        Just curious, what does Spyglass mean here?

                        John R.
                      • em315
                        Spyglass Mosaic was one of the first commercial web browsers; it was a licensed version of NCSA Mosaic (the first graphical browser).
                        Message 11 of 14 , Apr 19, 2012
                          Spyglass Mosaic was one of the first commercial web browsers; it was a licensed version of NCSA Mosaic (the first graphical browser).

                          --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@...> wrote:
                          >
                          > >I would have expected WP (and
                          > everything else of that era) to send the old
                          > Spyglass "open url" (WWW!OURL) event
                          >
                          > Just curious, what does Spyglass mean here?
                        • Smokey Ardisson
                          ... Interesting, indeed. It doesn t entirely surprise me, although it s sort-of sad that Classic was broken in that way, given the excellent integration it
                          Message 12 of 14 , Apr 19, 2012
                            On Wed Apr 18, 2012 11:13 pm ((PDT)), "John R" <johnrethorst@...> wrote:

                            >--- In wordperfectmac@yahoogroups.com,
                            >"sardisson" <smokey.ardisson@...> wrote:
                            >
                            >> It later occurred to me that event dispatch
                            >>might work differently in "pure" Mac OS inside
                            >>SheepShaver than with Classic+Mac OS X, so you
                            >>probably want to double-check that the initial
                            >>WWW!OURL still gets lost before doing "Stay
                            >>Open". That said, I expect that the problem
                            >>*will* still exist if I'm close to being right
                            >>about its cause…
                            >
                            >OS 10.4 running Classic needs a stay-open
                            >script. Sheepshaver does not. Interesting.

                            Interesting, indeed. It doesn't entirely
                            surprise me, although it's sort-of sad that
                            Classic was broken in that way, given the
                            excellent integration it had with Mac OS X
                            ("sort-of" because I'm sure writing an AppleEvent
                            handler in AppleScript is an edge case, and doing
                            it to support hooking Classic apps up to modern
                            browsers even moreso ;-) ).

                            >>I would have expected WP (and
                            >everything else of that era) to send the old
                            >Spyglass "open url" (WWW!OURL) event
                            >
                            >Just curious, what does Spyglass mean here?

                            Back in the early 90s, Spyglass introduced an API
                            for OS integration for web browsers (and
                            implemented the API in its commercial Mosaic
                            variant on the Mac and Windows; Microsoft would
                            later license Spyglass Mosaic as the basis for
                            early versions of IE); the API used to be
                            described at
                            http://www.spyglass.com:4040/newtechnology/integration/iapi.htm,
                            but a copy can today be found at
                            http://www3.di.uminho.pt/~fln/NetscapeAPI/iapi.html.
                            On the Mac it was implemented as an AppleScript
                            suite and is commonly called "the Spyglass Suite".

                            "Classic" Netscape and IE supported it, or most
                            of it, OmniWeb supported some of it, and older
                            versions of iCab appeared to have the most
                            complete implementation of the suite (iCab 4 has
                            only a small subset). Although Mozilla had an
                            implementation, it was not complete or was not
                            hooked up (I'm not sure which), so neither
                            Mozilla/Mozilla-based Netscapes nor later Firefox
                            supported the Spyglass suite, and Safari only has
                            hidden support for the WWW!OURL event, so the
                            suite eventually died out. Up through about
                            Adobe's version 5 of Dreamweaver, Dreamweaver
                            still sent that event, but an Adobe developer
                            told me a few years ago the next version would
                            finally switch to GURLGURL.

                            Another early internet-related AppleScript suite
                            definition is the URL suite, defined by John
                            Norstad and others:
                            http://ftp.sunet.se/pub/mac/comm/newswatcher/url-ae-standard-1-1.txt
                            GetURL (GURLGURL) itself survived as "open
                            location" in the OS, but the rest of the suite
                            had only limited support in the big browsers, so
                            it also pretty much withered away by the time we
                            made it to Mac OS X

                            So ends today's lesson on the history of web
                            browser AppleScripting; class dismissed! :-)

                            Smokey
                          • Chris Harshman
                            ... Mosaic wasn t the first graphical browser; I know Viola came before it, and I think there was another project that TBL was in some way affiliated with that
                            Message 13 of 14 , Apr 19, 2012
                              On Thu, Apr 19, 2012 at 6:20 AM, em315 <em315@...> wrote:

                              > **
                              >
                              > Spyglass Mosaic was one of the first commercial web browsers; it was a
                              > licensed version of NCSA Mosaic (the first graphical browser).
                              >

                              Mosaic wasn't the first graphical browser; I know Viola came before it, and
                              I think there was another project that TBL was in some way affiliated with
                              that was even earlier, and ran on DEC Ultrix machines (it was installed on
                              a microVAX 3100 when I was an undergrad)... But it was the first successful
                              browser. Marc Andreesen was one of (if not the?) principal developer of
                              Mosaic while he was a student at NCSA/UIUC (anyone remember when NCSA
                              Telnet was a required Mac application, back before SSH became a de facto
                              requirement?), and then took his skills to Sili Valley to launch Netscape.

                              Also, Spyglass Mosaic only shared a name with NCSA Mosaic. Spyglass Mosaic
                              went on to become Internet Explorer. NCSA Mosaic begat Netscape Navigator
                              (though Netscape did not use any NCSA code, IIRC).

                              "I was *there*, man..." (My first 'web' experience was on VT220 terminals
                              running Lynx; Mosaic-on-Motif on a Novell UnixWare workstation was
                              heavenly. Netscape 1.1n on my System 7-era Macintosh was the bomb dignity.
                              altavista.digital.com "FTW," as they say... Before the Google.
                              Contemporaneous with the Eternal September... ;)


                              [Non-text portions of this message have been removed]
                            • John R
                              It s great to have such knowledgeable people here. Thanks again, Smokey. John R.
                              Message 14 of 14 , Apr 19, 2012
                                It's great to have such knowledgeable people here. Thanks again, Smokey.

                                John R.



                                --- In wordperfectmac@yahoogroups.com, Smokey Ardisson <smokey.ardisson@...> wrote:

                                > Interesting, indeed. It doesn't entirely
                                > surprise me, although it's sort-of sad that
                                > Classic was broken in that way, given the
                                > excellent integration it had with Mac OS X
                                > ("sort-of" because I'm sure writing an AppleEvent
                                > handler in AppleScript is an edge case, and doing
                                > it to support hooking Classic apps up to modern
                                > browsers even moreso ;-) ).
                                >
                                > >>I would have expected WP (and
                                > >everything else of that era) to send the old
                                > >Spyglass "open url" (WWW!OURL) event
                                > >
                                > >Just curious, what does Spyglass mean here?
                                >
                                > Back in the early 90s, Spyglass introduced an API
                                > for OS integration for web browsers (and
                                > implemented the API in its commercial Mosaic
                                > variant on the Mac and Windows; Microsoft would
                                > later license Spyglass Mosaic as the basis for
                                > early versions of IE); the API used to be
                                > described at
                                > http://www.spyglass.com:4040/newtechnology/integration/iapi.htm,
                                > but a copy can today be found at
                                > http://www3.di.uminho.pt/~fln/NetscapeAPI/iapi.html.
                                > On the Mac it was implemented as an AppleScript
                                > suite and is commonly called "the Spyglass Suite".
                                >
                                > "Classic" Netscape and IE supported it, or most
                                > of it, OmniWeb supported some of it, and older
                                > versions of iCab appeared to have the most
                                > complete implementation of the suite (iCab 4 has
                                > only a small subset). Although Mozilla had an
                                > implementation, it was not complete or was not
                                > hooked up (I'm not sure which), so neither
                                > Mozilla/Mozilla-based Netscapes nor later Firefox
                                > supported the Spyglass suite, and Safari only has
                                > hidden support for the WWW!OURL event, so the
                                > suite eventually died out. Up through about
                                > Adobe's version 5 of Dreamweaver, Dreamweaver
                                > still sent that event, but an Adobe developer
                                > told me a few years ago the next version would
                                > finally switch to GURLGURL.
                                >
                                > Another early internet-related AppleScript suite
                                > definition is the URL suite, defined by John
                                > Norstad and others:
                                > http://ftp.sunet.se/pub/mac/comm/newswatcher/url-ae-standard-1-1.txt
                                > GetURL (GURLGURL) itself survived as "open
                                > location" in the OS, but the rest of the suite
                                > had only limited support in the big browsers, so
                                > it also pretty much withered away by the time we
                                > made it to Mac OS X
                                >
                                > So ends today's lesson on the history of web
                                > browser AppleScripting; class dismissed! :-)
                                >
                                > Smokey
                                >
                              Your message has been successfully submitted and would be delivered to recipients shortly.