Viewing downloaded html-code in a webview -AppleEventhandler failed(-10000)

I am trying to view downloaded html-code in a webview in AppleScript Studio. Showing the raw html text in the textwindow works ok, but I am getting an error message trying to output the code to the webview.
I really googled for a solution to this before posting, but haven´t found anything.
It´s the last line "call method "loadHTMLString:baseURL:"....." that is giving me the error.
What´s wrong?
on launched theObject
-- this downloads the source from www.google.com into the variable myhtml
-- and displays the source in a text view window:
set myhtml to do shell script "curl www.google.com"
set contents of text view "textwindow" of scroll view "textwindow" of window "textwindow" to myhtml
-- this should give a variable that points to the webview in the webview window
-- everything in this window is labeled "webwindow" in the applescript properties in IB:
set webwindow to call method "mainFrame" of object (view "webwindow" of window "webwindow")
call method "loadHTMLString:baseURL:" of webwindow with parameters {myhtml, null}
end launched
AppleScript Error
AppleEvent handler failed. (-10000)
[Session started at 2008-12-30 14:09:48 +0100.]
2008-12-30 14:09:49.395 webkladd2[15485:10b] * -[NSCFNumber absoluteURL]: unrecognized selector sent to instance 0x2cea40
2008-12-30 14:09:49.397 webkladd2[15485:10b] An exception was thrown during execution of an NSScriptCommand...
2008-12-30 14:09:49.399 webkladd2[15485:10b] * -[NSCFNumber absoluteURL]: unrecognized selector sent to instance 0x2cea40

Hello
IF I'm not mistaken, you should provide "http://www.google.com/" for baseURL of your html source obtained from "http://www.google.com" unless this page defines its own base.
So you might try something like -
--SNIPPET
set myhtml to do shell script ("curl " & "http://www.google.com")
set nsstring to call method "stringWithString:" of class "NSString" with parameter "http://www.google.com/"
set urlstring to call method "stringByAddingPercentEscapesUsingEncoding:" of nsstring with parameter 4 -- UTF-8
set nsurl to call method "URLWithString:" of class "NSURL" with parameter urlstring
set webwindow to call method "mainFrame" of object (view "webwindow" of window "webwindow")
call method "loadHTMLString:baseURL:" of webwindow with parameters {myhtml, nsurl}
--END OF SNIPPET
cf.
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic /
Snippet is NOT tested, though I did go by the book as best I could.
Good luck,
H

Similar Messages

  • View/Change HTML Code on pages...

    There are certain things I'm interested in doing and I'm wondering if it is possible to work iWeb similar to Dreamweaver with a split screen so you can see and play with the HTML code...

    Thank you, still learning it all.
    So, then, once published to a folder you could play with the code and then see how it works out when it goes live to the web?
    plain text editor? Sorry, still very new to much of this. so, I can use Mac's TextEdit or Microsoft's Word?

  • How do I view my html codes on my macbook pro?

    I know my coding is perfect, I used to work on the pc with it. Now moving to a Mac... I'm having such difficulty its starting to frustrate me. I've googled ways to solve it and they all say change the rich text and so on so forth. I've done that yet no change has occured for me. When I bought this, I asked if I could do my codes on it and the guy said yes, that I could do it straight from my textedit. It seems he lied or Im screwing up somewhere.
    Please if anyone has the answer to this problem let me know what I'm doing wrong. I'd gladly appreciate it.

    ShellB89 wrote:
    yes fane my code line is perfect meaning that it is flawless
    Gosh! They must've broken the mold after you.
    i used notepad on the pc and just saved as .html
    So use TextEdit and save as .html. When you invoke the Save dialogue, enter .html as the file name extension; if .txt is entered automatically, replace it with .html.
    i am having a problem saving as a .html
    What's the problem?
    being able to preview my work
    Close your .html file and open it again in TextEdit or Safari or another browser. TextEdit's behaviour is controlled by the Open and Save preference. If "Ignore rich text commands in HTML files" is checked, TextEdit will not interpret the HTML markup. If it is disabled, TextEdit will render the HTML markup. "Ignore rich text commands" also appears in the Open dialogue, so you can defeat per file this option.
    i simply see the html typed in txt format the way i saved it not background color title or anything.
    I suppose you mean the HTML markup is not rendered. See above. If you mean syntax highlighting, that's different, but, AFAIK, Notepad does not feature syntax highlighting.
    For HTML work, you should probably check out
    TextWrangler
    <http://www.barebones.com/products/textwrangler/>
    which is free, but a good deal more powerful than TextEdit, and does feature syntax highlighting.

  • While in Edit Mode in Moodle - page content does not render at all, but I am able to display the underlying HTML code. Happens only after upgrade to Firefox 11.0.

    While in edit mode in the Moodle course management system, the Page Content window should display the page as it will appear to the user. If you click on the "Edit" button, you are able to view the HTML code for the page. However, when you return to the normal display mode, the page is blank. This has occurred after the upgrade to Firefox 11.0. Page is normally rendered in Internet Explorer.

    A possible cause is security software (firewall,anti-virus) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls
    See also:
    *http://kb.mozillazine.org/Error_loading_websites
    *https://support.mozilla.org/kb/Error+loading+web+sites

  • How do I paste a snippet of HTML code into my website

    I downloaded HTML code that creates a clock with the date & time to paste into my website. How do I paste the code into the site?
    I tried pasting the code onto the page in iWeb and it just shows up as if its just text.

    Yes, though I don't know if it applies to exactly what you want to do:
    http://alyeska.altervista.org/en/iWeb_Forms.html

  • Put your own HTML Codes?

    Is there a way to view the html code, and then place your own code in it just like you would with dreamweaver?

    Here's what I found. Some people might find it useful.
    I wanted to include some php code in a page.
    1 Include a text box in the page design which will display the result of your code. Put some marker in the box which will be easy to find like "php-code-goes-here".
    2 Publish the site to a folder.
    3 open your html editor, I recommend bbedit.
    4 open the file for the page and search for the marker you inserted. Replace the marker with your php code.
    5 save the file, remembering to rename it with a .php extension
    6 search all the other files in that site folder for references to the original .html file and change these references to the new .php file.
    7 upload the site folder to your server. you can delete the original html file if you like.
    8 bask in the glow that comes when your app works and smile.
    I guess this will work with java script and other code as well. I don't have a .mac account so I don't know if this works or even if .mac is enabled for php.
    G4 dual 1.42   Mac OS X (10.4.4)   ibook G4

  • CSS or HTML code to create resizable images to display in small view

    I am a book publisher and am publishing books to be read on Adobe Digital Editions. I'm looking for the CSS or HTML code to create resizable images that will display in "small view." Does anyone happen to know how to do this?

    hi,
    Our customers want to start reports by pushing a button instead of clicking on a link inside a dashboard.Create a dashboard page with all buttons referring to your dashboards....Is that fine???
    There u ll refer to your dashboard which has download,refresh all the options
    thanks,
    saichand.v

  • HTML code displays on one line in browser view source

    Hi,
    In Dreamweaver, my HTML code displays returns, spaces, etc. However, in the view source option in a browser (Firefox in particular), all the code is displayed on one single line. I only found about this because I was having problems with my Google Ads not displaying. (A Google customer service person helped me to find a workaround for this since I still haven't figured how to get my code to display correctly.) So I have gone to Preferences in DW and changed my Code Format Line Break type. The result is the same with each of the three options: the code is all on one line when you check it under view source in a browser. (The server is Linux.)
    Does anyone know how to fix this? Also, I think I know how this happened in the first place. I copied my code to TextEdit for a quick backup the other day, and then I pasted it back to DW. Bad idea? Is the only way to get the code back to normal to re-write it in a new HTML file in DW?

    Pssh. Problem solved, but I'm not quite sure how. I did go back and try to clean up some redundant CSS and other things, but the HTML/CSS validator still shows that I have this one invalid <header> tag (www.nextmontenegro.com), but since that was written as part of the DW template, I just left it. Weird. Anyway, the code flows down the page now.
    Thanks for the quick replies and helpful hints:-)

  • Dreamweaver HTML Code view too small since Mac OS X 10.6.3

    Has anyone run into this issue, since I loaded Snow Leopard my HTML code files viewed in Dreamweaver are so small and hard to read. The CSS files are just fine and a normal size. I have not found a way to increase the size of the view and that feature is not available - to zoom by percentage.
    Dreamweaver HTML files are also small on my macbook.
    Karlopa

    Has anyone run into this issue, since I loaded Snow Leopard my HTML code files viewed in Dreamweaver are so small and hard to read. The CSS files are just fine and a normal size. I have not found a way to increase the size of the view and that feature is not available - to zoom by percentage.
    Dreamweaver HTML files are also small on my macbook.
    Karlopa

  • View the html source code of an apex page

    Hi everyone,
    I search to how I can view the html source code of an apex page and to be able to modify it. That's why viewing the html source code from the browser when the application is running doesn't arrange me.
    Has anyone an idea how it can this be possible?
    Best regards,

    Khadija Khalfallah wrote:
    Hi everyone,
    I search to how I can view the html source code of an apex page and to be able to modify it. That's why viewing the html source code from the browser when the application is running doesn't arrange me. What do you mean?
    Do you want to be able to pull up the HTML source generated by Apex, modify that copy, and then feed it back into Apex with the chagnes you made? If so you can't. Apex generates the HTML through its tools and you have to modify the generation routines to get different HTML.
    Do you merely want to look at the generated HTML? In Internet Explorer all you have to do is right click on the page and choose View Source to open a window with the HTML source in an editor. I sometimes find it useful to save a page and manually edit the copy to immediately see the effects of certain changes to the underlying HTML and/or Javascript without permanantly making the change in Apex.

  • View the source code before deciding which PHP CMS to download?

    Maybe no one knows this site, for I just was recommend by a friend, if you want to install an Open Source [PHP CMS|http://www.phpkode.com/projects/category/php-cms/] but don't know which one to choose you can visit PHPKode.com and first view the source code of this PHP CMS with the file list feature on the page before installing it...

    If you use SAPlink http://www.saplink.org - you can download the entire component.
    If you want just the classes, that is a little bit harder.  The classes are dynamically generated.  There are different tricks to find out what the class names are. You should NEVER directly interact with the underlying classes. However if you just want to view the code in them you can see the class names in the debugger.  Also if you want, you can just set a breakpoint within one of the methods and then choose utilities->breakpoints->display . You will see the name of the class where your breakpoint is set.  It will be something like: /1BCWDY/4XLHG76LQV8VMTT2GRB2  - however you might find that it is difficult to look at the code from these classes; as we now restrict the ability to pull them up in the class editor.  You just get a message that the object does not exist or is not assigned to a package. This restriction is a protection to keep anyone from accidentally changing the generated objects and corrupting the WD Component.

  • How can I view html codes ?

    I have some text and images composed in a yahoo group.  I need to cut and paste it into an html box on MYSPACE.  I've already tried checking Yahoo's "View html Source" box.  Nothing appears.  I also tried clicking on my imac "View Source" in the tool bar, pasted the code into the html box but only got code, not text and images. 
    Is this something that can't be done unless you are an html code wiz?

    I don't use Myspace, but if you're given an HTML box to fill in, it will almost certainly show as code until you submit it, and then, if the code is correct, it should display your layout correctly as text and images on the new page.
    Note that images may not transfer correctly unless their source tags contain absolute references - eg "http://yahoo.com/images/myimage1.jpg" should be fine, but "../images/image1.jpg" will not work.
    Matt

  • Using text edit to view html code

    Why does text edit open a web page as if it's a web browser??? I want to use text edit to edit my html code and I can't open a web page in plain text view...it tries to render the page. Doesn't Apple have a text only app like Notepad for Windows?

    I searched for text edit, not textedit - until after I posted this. sorry

  • Change html code in page you're viewing automatically

    How to make firefox automatically edit certain html code on certain web pages
    Like on webpages I can right click inspect element and it will allow me to delete things off the page.
    I want this to happen automatically for certain webpages when containing certain html code

    I tend to write custom scripts for this sort of thing, but for a couple of more general purpose removers, you could investigate these:
    * "Remove it Permanently" can be trained to remove items from a page every time you visit. I believe it works by right-clicking what you want to remove. https://addons.mozilla.org/en-US/firefox/addon/remove-it-permanently/
    * A review on that page recommended Element Hiding Helper, which is a companion add-on for Adblock Plus. If you already use Adblock Plus, this is probably a more efficient combination. https://addons.mozilla.org/en-US/firefox/addon/elemhidehelper/

  • Is Muse compatible with Email Service Providers. I found html code issues - PCs have viewing issues

    Is Muse compatible with Email Service Providers? A colleague said Muse has html code issues as PCs struggle to display the artwork correctly when emails are delivered.

    Is Muse compatible with Email Service Providers? A colleague said Muse has html code issues as PCs struggle to display the artwork correctly when emails are delivered.

Maybe you are looking for