Button that opens website or sends http commands

I have a cocoa-applescript application that contains a window called "Window," a WebView called "Browser" and a Button called "go."
All I would like to be able to do is push the button and it opens a website in the WebView. This seems simple but I cannot figure it out.
Also if possible, since another button will be just giving commands to something over the internet, is there a way to send the http command without displaying the website?
Just as some further Info, I am trying to make something to control my IP Webcam. Most of the commands it needs are in the form of "http://(ip address):(Port)/(the command).cgi"

Didn't my WebView example help?
Assuming you have an IB outlet connection from your webview to your script's instance for it (for example, myWebView), and an IB action connection from your button to your script's button handler, the code in your button handler would be something like:set theURL to current application's class "NSURL"'s URLWithString_("http://www.apple.com") -- or whatever
myWebView's mainFrame's loadRequest_(current application's class "NSURLRequest"'s requestWithURL_(theURL))
If all you want to do is send the command without any webview, you can use the curl shell utility.

Similar Messages

  • Create a Button that Opens a Specific Web Link from a Dropdown Box

    Hi guys.  My main question is, how do I make a Button that opens a specific Web Link, depending on the URL selected in a Dropdown box?
    Example:
    I'm a comlpete newbie and need a code sample of how this would work!  Thanks!
    I have a couple other questions which are related to this. 
    1) Is it possible to hide the URL in the Dropdown list, and only show the Name, so for examlpe, it would only list Hotmail, Gmail, Yahoo, and not the www....com?
    2) Another more advanced question is, once the web link is opened, is it possible to have adobe input or fill-in the Login and Password fields into the website and then hit "Enter" for you.  The Username and Password would be stored somewhere in adobe and would depend on the weblink opened. So for example: When you open Hotmail, it would use the following; Username:[email protected] and Password:password1, but if you opened Gmail, it would use a different Username and Password stored for Gmail.
    3) Finally, out of curiousity, is it possible to have adobe extract data from a website, and fill them into an adobe form?  This maybe over my head, but any starting point or examples would be of great help!

    Use something like this as the button's MouseUp action:
    app.launchURL(this.getField("URL Dropdown").value));
    To answer your other questions:
    1) Yes. Place the URL as the export value of each option, and the name of the site as the display value. The code I provided can remain the same.
    2) No.
    3) Might be possible, but it's very tricky. The way to do it would be to convert the website to a PDF, process that PDF to extract the data from it, and then use that to populate the form fields. That would require quite advanced scripting knowledge, but it could be possible.

  • I have a button that opens a PDF that crashes Moodle and Scorm Cloud. How can I fix this?

    I'm using adobe Captivate 5.5
    I have a button that opens a PDF that crashes the course when in an LMS (I've tried moodle and scorm cloud). When I play the course in my browser, the file opens fine and the course continues. Does anyone know why opening this file doesn't work when I upload the SCORM package to an LMS?
    Thanks,
    Chris

    Hi aperio_chris,
    Thank you for contacting adobe support.
    Please use the following steps and let us know if that helps:
    1. In the publish setting>>externalize resources>>check all the check box which are for attachment, widget, animation etc.
    2. Check the flash player version change it to version 9 or 10 when publishing the output through Adobe Captivate.
    Thanks and Regards
    Loveesh

  • Create a button that opens a XML data file

    I have a PDF form that was created in LifeCycle Designer. I want to have a button that when you click on it, it will open the "select File window" so that you can then import an XML data file to the PDF form.
    You can do this option manually when you are Adobe Reader in the Form by clicking Advanced, Data, Import Data to Form.
    I want to automate that by just clicking a button. Does anyone know the script to use behind the button to make this work. It's gotta be easy but I can't figure out how to bring up the "Select File Window"
    Can anyone help.
    Thanks
    Sean

    Hi Sean,
    You can import an XML data file by clicking a button, with following code:
    xfa.host.importData();

  • Hwo to create a button that opens a popup

    Hallo,
    I wanna create a button on a page (thats not the problem) that opens a popup where data from a table (two rows) is in.
    I found different documents but nothing that really solves the problem.
    Any idea and helps is really appreciated.
    Thanks and regards, Jade

    Hi Jade
    I'm not sure what documents you've looked and why they haven't helped you. To call any page as a popup, you just need to run some javascript:
    <script type="text/javascript">
    function callMyPopup () {
    var url;
    url = 'f?p=&APP_ID.:123:&APP_SESSION.';
    w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
    if (w.opener == null)
      w.opener = self;
    w.focus();
    </script>
    and you button should call the javascript function:onClick="javascript:callMyPopup();"
    I tend to put things like this in A tags on my page.
    Is there something further that you need to do with the popup report?  Do you need to set some value to filter the report and/or return a selected value from the report back to the calling page?
    Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Friend received a text from me saying that to read the text he should hit the download button that i did not send

    Just got a text from a friend that claims he received a text from me. This text told him that to "receive my text" he needed to hit a download button that was in the text. i DID NOT send him any text! This is alarming! I immediately changed my Apple ID and password. Should i be worried? Has anyone experienced this and what does it mean?!

    Perhaps your friends phone has been hacked.
    Unless yours has been jailbroken, it has not been hacked.
    It would seem far more likely that your friend has the issue, than you.

  • Does anyone know the apple script or unix command in ARD that allows me to send keystroke commands to computers on my ARD network ? thanks !

    I am trying to cue computers through keystroke commands using ARD
    I want to know a unix shell or script command to hit keystrokes on my ARD machines.
    EXAMPLE... I want machine X  to press the letter K.
    I am also wondering if you can send multiple commands doing this , multiple keystrokes with built in delays
    Thank you

    Welcome,
    I use the "System Events" handler, e.g.:
              tell application "System Events" to delay 5.5
              tell application "System Events" to keystroke "K"
              tell application "System Events" to delay 0.5
              tell application "System Events" to keystroke return
    Regards,
    Shawn

  • How to Direct open Website link to https: ( port 443)

    In my web server i host website on port 443 using SSl certificate. when my user try to access this website they nee to put manually address like https://siteneme..? how to open this website direct without type https

    You can configure a redirection from http to https so that when the user types www.contoso.com it will get redirected to https://www.contoso.com.
    You can do that on your load balancer if you are using one or on the Website configuration.
    This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
    Get Active Directory User Last Logon
    Create an Active Directory test domain similar to the production one
    Management of test accounts in an Active Directory production domain - Part I
    Management of test accounts in an Active Directory production domain - Part II
    Management of test accounts in an Active Directory production domain - Part III
    Reset Active Directory user password

  • GUI that open a Linux terminal, run commands and retrieve results

    Hi
    I am currently designing a GUI that should make it easier for users to execute a command line statement and read the information that is returned.
    I should not have any issues with the actual GUI, but I have not been able to find any examples to help with how to open a command terminal, enter a command and retrieve the results. I am aware that using a screen scraper is a possibility, but if anyone is aware of any examples to achieve this, that would be great.
    Thanks
    Matt

    Is the command line app a simple, straightforward one
    that just prints its output? (Eg. ls, dmesg, or any application
    that simply print results without reading input)
    If so, try this tutorial on calling a program
    and reading its output:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    But if your commandline app is a rich-interactive one
    (eg. a full screen menu program or full screen text editor
    or something), then it's much much more complicated.

  • Can I disable the button that opens my DVD Drive?

    The button on my dvd drive is so sensitive that it's hard to touch the side of my T510 withou accidentally opening the drive. VERRRy annoying.
    I'm loking for a way to disable the manual button.
    Is there a solution for this?

    I wrote LockCD application after giving up on finding a properly functioning software that would lock the CD ROM eject button which i hit quite frequently on my Lenovo T520 laptop. The main problem with the software found over the internet was that it wouldn't retain the lock state after Sleep/Resume. I made it freely available at http://sourceforge.net/p/lockcd/wiki/Home/

  • How can I add a button that opens a new tab?

    How can I quickly open a new (blank) tab without going to File --> Open New Tab. There has to be a button I can add or a box that isn't checked somewhere. I used to be able to click in the blank space in the row of tabs to open a new tab, but with this latest Firefox update, if I click in the blank space now, it just "restores" my browser window.
    To explain further - I know I can middle-click a link to open it in a new window, but if I'm on one page reading an article, and I want to open a new tab to look up a word or map or whatever, I need a faster way to open a new blank tab.

    You are right - there should be and there is on my windows 7 machine but not on my windows 8.1 machine. Firefox add-ins are identical. So how do I get the new tab button back?

  • How to create a dialog window with no button that opens along with the main window?

    When the main window is open, the dialog window opens up immediately and can be closed by key press. At other times, when the next step, ie: decision, comes to, the another dialog window pops up again and is again closed by key press. Does anyone know how to do? Use the sub-Vi? notification method? occurrence method?
    And another thing: how to create a reusable dialog window with no button so that different messages can be sent to it and it can closed by key press. And how to pass the string to the title of the dialog window programmatically?

    For your functionality (If I understand it right), nothing needs to be in the event structure. Pressing any key just triggers the event, thus finishing the VI (there is no while loop).
    Could you tell me what you mean my "it won't run properly"? Make sure that the front panel of the subVI is closed before starting the main VI. Remember that the subVI is set to "open when called" and "close afterwards if originally closed". So, if you had the panel open already, it won't of course close when finished!
    (Actually, the problems is worse when you have the subVI panel open when starting the main VI. you get a catch22 and labVIEW locks up because (1) the subVI is set to dialog and grabs all attention but (2) it has not been
    called, thus the event cannot be triggered. So don't do that!!!! As a quick workaround, add the modification shown in the attached image to ensure the panel of the subVI is closed.)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    CloseNoButtonDialog.gif ‏3 KB

  • My Firefox browser will only open websites starting with "https". What is preventing my browser to open a non-secure (http) website ? Please help!!

    I have checked my Firewall settings and added Mozilla Firefox to the list of programs accepted. I have also uninstalled Firefox & reinstalled it twice. I have turned off my antivirus & I still can't open a non-secure browser.

    Thank you, thank you, thank you FredMcD!! It was my AVAST anti-virus software. I had the "Web Shield" turned on, so all I did was turn it OFF, so now I can browse on the Internet on any website. When you first install Avast anti-virus, the Web Shield by default is turned on. This really should be turned off as not to freak out new users, especially by those that are not computer savvy. I cannot thank you enough! Take care. :-D

  • I was unable to access migrate assistant to reinstall my hard drive. I didn't know if it would work but I used the time machine restore button that opens up in the space movie. The computer said it would download it to "Volumes". Now I can't find it.

    I was unable to access migrate assistant to restore my hard drive. Out of desperation and ignorance I opened up Time Machines space page and selected my most recent backup and pushed restore. The system accepted it and said it would intall in in "volumes". I was unable to figure out what that meant but I went a head a tried it. The download took four hours and then puff it was gone and so was my data. I can't find the back up anywhere. The only thing I think it might be is that I had named the hard drive a different name than the original (don't ask me why). Have any ideas?

    Choose Go to Folder from the Finder's Go menu and provide /Volumes/ as the path.
    (71792)

  • How do I get a smartshape button that open the TOC and pause the project when it is selected?

    Please help! I created a smartshape button and assigned it the action of making the table of contents visible when clicked. However, now I also need the project to pause when the TOC button is clicked. Can someone please guide in as to what I need to do? Thanks

    Hi,
    Please follow the below steps.
    1) Create an advanced action with the action "Show TOC"
    2) Insert a smart shape and use it as button
    3) Execute the advanced action on success of the shape button.
    In the published output, movie will not continue on clicking the shape. Please let me know if it solves your issue.
    Regards,
    Haridoss

Maybe you are looking for

  • Using a TV

    I have a Mac Mini which I use for both home office and media center. When just working I use my Thunderbolt Display, works like a charm. I want to use the HDMI for connecting to my Samsung HD TV. Only thing is when I connect the display is always "on

  • Query to be saved in Application Server

    Hi Gurus , We are on BI 7.0  SP 10 , We have a requirement, to send a Query Report to an Application Server . Is it Possible ??? If yes how ? Appreciate if you can give in detail how we can implement this in BI 7.0 . Waiting for a quick Reply . Thank

  • Hey guys can u help me activate a pre owned iphone 4

    help

  • What is the reason for this "max connections" error?

    RH9 Server On attempting a publish, the RH server is not contactable. The Web ADmin has reported this message: "java.sql.SQLException: Maximum possible connections are open and all the connections are busy. Kindly review the "maxload" in the server.p

  • Spyware for iPhone 4

    Are there any available spyware apps for an iPhone 4?