Applescript "do javascript" click link

Hi, I want to make a script that opens a web page in Safari, then clicks on a link. however the link is javascript, with a self referrential href
Does this code look like it should be working, becuse it jsut gives a blank page.
on run
launch application "Safari"
tell application "Safari"
make new document at end of documents
set URL of document 1 to "http://www.biggercity.com/chat"
do JavaScript "bcStartCamsOnly()" in document 1
(*actual link is *)
end tell
end run

Blah nevermind - pretend I never asked this question....

Similar Messages

  • RH7 HTML - Receive IE script error message when double-clicking link to auto-size pop-up

    Hi, all,
    Anybody ever seen this situation? When double-clicking on a link to an auto-size pop-up, I get the following Internet Explorer script error message:
    This error also occurs when I double-click the link in preview mode within the project. A colleague that is running the same version of IE with the same settings is not receiving this error. A couple of other co-workers are running a different version of IE, and one gets this error and one does not.
    This error does not occur if you single-click the link (which you would normally do), nor does it occur if you double-click a link to a fixed-size pop-up. Once you receive this message and click Yes or No, the link sometimes works correctly when you double-click. I haven't been able to establish a pattern. Also, if you single click the link to display the pop-up, click off of it, and then double-click the link, the error does not occur.
    As you can tell by now, this problem is kind of hard to pin down. I've done some research and I have yet to stumble upon anything that deals with this issue. Unless there is a solution out there, I can do one of two things: 1) change all of the auto-size pop-ups in the project to fixed-sized, which defeats the purpose of creating auto-size pop-ups, or 2) tell our customer not to double-click links.
    Any advice you could give would be welcome.

    Hi there
    Indeed it has been reported on many occasions over the years. Unless someone like Willam has some way cool error detection magick with the scripts, the best approach we have always offered is this.
    Educate your users on the way computers and HTML works. HTML works using SINGLE clicks, not DOUBLE clicks.
    The reason for the error is because the first click caused the computer to launch a JavaScript command to open the sized popup. The second click that followed in rapid succession confused things by asking the script to stop what it was doing and run again.
    Maybe it would help to explain it to your users like this. If you visited a restaurant and when the server asked what you wanted to order, would the become confused if you said to them: I'll have the T-Bone Steak and nearly immediately you repeated it by saying again I'll have the T-Bone Steak.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Uploading a File with AppleScript via JavaScript

    Hi everybody,
    being new to AppleScripting and JavaScripting I'm faced with the following problem:
    Is it possible to make AppleScript to input the path for a file to be uploaded via JavaScript? If yes, what should be the correct Path Format and how to wrap it up the JavaScript action into AppleScript? I've tried a few comands but to no success.
    On the webpage in question, there's a "Choose" button, that is defined as follows:
    <input type=​"file" class=​"gwt-FileUpload" name=​"swfFile">​
    I've been trying to use the following syntax:
    do JavaScript "document.getElementsByName('swfFile')[0].value('Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf')" in document 1
    as well as this one, where the Path is definitelly understood by shellscript:
    do JavaScript "document.getElementsByName('swfFile')[0].value('/Users/myaccount/Desktop/Scrap book/!动画.swf')" in document 1
    The name of the file is (and must remain) in chinese, but for testing purposes I have also tried files with english names, without success.
    Currently I'm using a solution with JavaScript comand:
    do JavaScript "document.getElementsByName('swfFile')[0].click()" in document 1
    to click the finder  window to browse for the file, and manipulating  keystrokes by using System Events to find the right file, but it's not  infallible with a number of files and it's hardly an ellegant sollution.
    Any idea what I'm doing wrong?
    Cheers!

    @twtwtw
    the do JavaScript "document.forms[0].submit()" command didn't work, so I kept the original way of submitting by clicking the button. The submitting part works, but not the input file part.
    That's the code I used
        tell application "Safari"
            do JavaScript "document.getElementById('gwt-uid-13').value='on'" in document 1
            do JavaScript "document.forms[0].elements['swfFile'].value=" & "'" & SWFFilePath & "'" in document 1
            do JavaScript "document.getElementsByClassName('gwt-SubmitButton')[0].click()" in document 1  
            delay 1
        end tell
    with SWFFilePath set as the POSIX path as well as the default file format
    Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf'
    but it did not work.
    If you've got the time, feel free to upload an .swf. The service is free and the server delats uploaded files after 15 min. (if you don't have any, you may try an empty .txt file instead - it won't get converted, but the point is just to get it into the input box).
    In the meantime, I'll have a look at adayzdone's suggestion. It's not perfect (the downside being that it requires the window to be active, so I can't run the script in the background or with my screensaver & password on), but it's still more reliable than my sollution with navigating arrowkeyes.

  • Javascript text link in PDF??

    Is there a way to insert a javascript text link in a PDF? I've added web links to text, but I just want to insert some javascript so when the user clicks on the text, it runs my script
    I post problem in many forums but not got the best answer
    any help would be greatly appreciated!
    Thanks

    Possible in Adobe Acrobat, not Adobe Reader.

  • Can Javascript text link in PDF?

    Is there a way to insert a javascript text link in a PDF? I've added web links to text, but I just want to insert some javascript so when the user clicks on the text, it runs my script
    I post problem in many forums but not got the best answer
    any help would be greatly appreciated!
    Thanks

    Just create a link with the Link tool and specify a JavaScript action.
    George

  • I open facebook or other site. right click link/photo to open in new tab quickly. Then all tab connection will be connection to website, all page stop loading. Have to close firefox and reopen then only site will load.

    I open facebook or other site. right click link/photo to open in new tab quickly. Then all tab connection will be connection to website, all page stop loading. Have to close firefox and reopen then only site will load.

    You can override how links are opened via the browser.link.open_newwindow.override pref.
    *http://kb.mozillazine.org/browser.link.open_newwindow
    *1: current tab; 2:new window; 3:new tab;
    Use this for links opened via JavaScript.
    *http://kb.mozillazine.org/browser.link.open_newwindow.restriction
    See also:
    *http://kb.mozillazine.org/Prevent_websites_from_disabling_new_window_features

  • Javascript popup link not working

    I've searched everywhere so trying to post here to see if anyone has encountered this.  I have a javascript popup link in a PDF.  Using Reader 9 and IE8.  When I click the link it asks me if I want to allow or not.  When I say allow, I then get an IE error that reads:
    Internet Explorer cannot download file  .
    Unspecified Error
    I've noticed that if I already have IE running, then the link works.  But if I don't have an IE window open I get the error.  The link looks like this:
    javascript:void(window.open('http://servername/appname/apppage.aspx?id=2','_blank','width=700,height=500,tool bar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0'))
    This link has to be a javascript window.open based on how it is generated.  The PDF is generated by SQL reporting services and the online version of the report needs to launch a new window for this application - the PDF is created directly from the online version of the report.

    Please repost in the Acrobat Scripting forum.

  • Applescript/Automator - Open all links on a webpage

    I am stuck trying to build an Applescript or Automator Workflow that goes to a predefined web page, and then loads each of the links found on the web page.  The catch is that I want to loop through one at a time (with a delay between each one). 
    I've been able to get all the urls to load simultaneously via Automator, but can't figure out how to loop through the urls with a delay.
    Thank you in advance for any tips.

    I figured out how to accomplish this by having applescript fire some javascript code inside safari (I read about it here:
    --http://stackoverflow.com/questions/5135609/can-applescript-access-browser-tabs-a nd-execute-javascript-in-them)
    .  Here's what my applescript looks like now:
    on run {input, parameters}
              tell application "Safari"
      activate
                        repeat with i from 1 to length of input
                                  make new document at the front of documents
                                  set the URL of the front document to item i of input
                                  delay 10
                                  do JavaScript "var links = document.getElementsByTagName('a');
    var match = 'http://www.google.com';
    for(var i=0; i<links.length; i++) {
      var href = links[i].getAttribute('href');
      if(href.indexOf(match) != -1) {
        document.location.href = href;
        break;
    }" in the front document
    delay 10
                                   close every window
                        end repeat
              end tell
      -- return input
    end run

  • How do I add a desktop link to gmail?  I have one email account as my safari home page because it has trouble with apple mail, but I want a one-click link to two other email accounts.

    How do I add a desktop link to additional email accounts?  I have one email account as my safari home page because it has trouble with apple mail, but I want a one-click link on my desktop that takes me to two other email accounts.

    Can you set up a rule in your old account to forward mail to your new account and then delete it from the old account?
    (1012)

  • Is it possible for Applescript to know what link is selected in the Indesign Links Palette?

    Hi there,
    I've written some ApplesScripts for Indesign that act on all links, missing links and/or selected links, but what if I wanted to perform an action on a link that is only selected in the links palette?
    Is it possible for AppleScript to know which link is selected in the Indesign links palette?
    Regards,
    David

    Hi czigrand,
    Thanks for visiting Apple Support Communities.
    Currently, you can gift dollar amounts or individual items (EG. songs) on the iTunes Store. See this article for more information:
    In the iTunes Store, you can gift a dollar amount or specific music, movies, TV shows, or apps from your iPhone, iPod touch, iPad, Mac, or PC. Follow these steps to send a gift from the iTunes Store.
    iTunes: Sending iTunes Gifts
    http://support.apple.com/kb/HT2736
    Best Regards,
    Jeremy

  • Have to repetitively click links in web pages to open  in Safari

    I notice that in Safari I have to click links in web pages multiple time to get them to open. I watch the progress bar to see if it is loading and look to see if the circle is spinning and it is not. I can wait for a while and still nothing so it is not me being impatient. It does it just about all the time on Facebook and it really seems to go nutz when I click links that are pictures. I constanly empty/clear my cache/cookies and run Onyx to clean up the system and still no luck. The system is completely up to date and has snow leopard 10.6.5 I even put new mouse batteries in just to rule out a clicking problem with it. It's like Safari just does not respond and has to be told twice or more to get going. Does anyone have any ideas or tricks that might help.
    Thanks

    Hi and welcome......
    Login to another user account on your Mac. Try Safari there.
    If you experience the same problem, launch Disk Utility /Applications/Utilities
    Select MacintoshHD in the Sidebar on the left then select the FirstAid tab. Click: Verify Disk
    If Disk Utility reports errors, follow the instructions at this link. You will need your install disc. Using Disk Utility to verify or repair disks
    Also, check System Preferences (Applications folder) - Universal Access. See if you have any accessibility features enabled, in particular, Mouse keys under the Mouse tab.
    Carolyn

  • How do I set Mail to launch clicked links in Safari, rather than Firefox?

    I have both Safari and Firefox installed on my computer. Safari is the default browser, but when I click a link on an email that I have received, Mail opens it in Firefox. This happens even if I have Safari open and Firefox closed. In that case, Mail opens Firefox and then displays the location of the link. I can't find an option in Mail settings, to set the default browser for clicked links to Safari.

    Great news Matt, thanks.
    Likely it was done when you installed Firefox, it asks if you want to make it the default browser.

  • Blank error message with ? appears and PDF does not open in Browser (IE11) when clicking link to open pdf. PC - IE11 Acrobat 9.0

    Blank error message with ? appears and PDF does not open in Browser (IE11) when clicking link to open pdf. PC - IE11 Acrobat 9.0
    Cannot access in browser PDF files unless blank box is closed and then website address is clicked on again in browser address bar and page reloaded.
    Uninstalled Acrobat 9, reinstalled, still same problem.
    Help please!

    Yes I can it only happens in the browser..
    I reinstalled Windows on my machine and started over a couple of weeks ago.
    When my desktop started up I didn’t have Acrobat installed and clicked on a pdf file and the open with xxx dialogue box came open.
    I chose a different program as Acrobat wasn’t installed yet so it associated pdf files with another program.
    Later Installed Acrobat and couldn’t associate the pdf file with acrobat so I went into Folder Options and manually associated PDF files with Acrobat.
    Ever since then I get the error when something is downloaded and opened in the browser.
    Works fine everywhere else and when I cancel the blank error, highlight the web address and press enter to reload it works 90% of the time.
    Not sure what to do..

  • IOS 7 problem after going to dodgy website after clicking link

    Hi. I need to totally reset my iPhone 4 (iOS 7) after clicking link to dodgy website. Not something I normally do. Now having problems with phone. Thinking reset may help. How is this done?
    Thanks

    Tunes froze when I upgraded to 10.2.1.1 after recently acquiring a 3rd generation Nano to replace my 1st generation that wouldn't reset. It's all working now after uninstalling 10.2.1.1 and then installing 10.1.2. I had to delete "iTunes Library.itl" for iTunes to load. I then had add my folder to get back all my Poscasts and then re-subscribe to my relevant podcasts. After this I upgraded back to 10.2.1.1 and everything is sweet . So effectively I rebuilt my "iTunes Library.itl" file - I suspect that this file became corrupted either during the iTunes upgrade and/or introducing mt new iPod Nano and/or something else.

  • All of a sudded, my firefox browser isnt allowing my to click links and open pages, or open anything on the top area of the screen.

    All of a sudded, my firefox browser isnt allowing my to click links and open pages, or open anything on the top area of the screen. For example i go to my email and i cant click on inbox, send, create, folders, mark as unread. It is like this on every website?? Its really annoying i cant do anything becasue most sites have login at the top of the screen and i cant login to anything.

    That problem can be caused by the Yahoo! Toolbar that extents too much downwards and covers the top part of the browser window and thus makes links in that part of the screen not clickable.
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    You can keep an eye on this thread:
    *[[/forums/contributors/707748]]

Maybe you are looking for

  • How to pass parameter values to a customer exit web item (WAD)

    Hi gurus, I have a wad with a data provider and a filter panel filtering that dp by using a variable. There is also a customer exit which saves the values of that variable into a z table. How can I pass the values of the filter panel to the customer

  • IBooks -- sync current read location between two devices??

    I have a book installed on both my iPhone and iPad. I might be reading on one or the other depending on circumstances. Is there any way sync where I am in the book between these devices? For example I might be reading from the iPad on the plane but w

  • Music lost in Katrina flood

    My computer and all back up disks were lost in my home, which was flooded due to hurricane Katrina. All the music I purchased during the past 2 years from the iTunes Music Store was lost. Without my compter hard drive and disks, I cannot retrieve the

  • Moving images/text across spreads

    I created a 40+ page manual as a document in InDesign. The spread I created (8.5 x 11) consists of two pages with images and text that go across both pages. Our printer is requesting that the book be set up exactly how it should print (i.e. page 1 is

  • And... we're back in the game

    http://www.apple.com/pr/library/2010/09/09statement.html Statement by Apple on App Store Review Guidelines The App Store℠ has revolutionized the way mobile applications are developed and distributed. With over 250,000 apps and 6.5 billion downloads,