Javascript or Java applet can run Applescript

Discussion in 'Mac Programming' started by magicleader, May 4, 2011.

  1. magicleader macrumors newbie

    May 4, 2011
    Hello to everyone,

    I'm searching about if it is possibile call an Applescript from Javascript or a Java applet.

    Because i want run an application installed on a client from a webpage using javascript or an applet or anything else?

    Thak you for you help
  2. jiminaus macrumors 65816


    Dec 16, 2010
    I damn well hope this isn't possible. I wouldn't want web pages to be able to arbitrarily run applications on my computer.
  3. MorphingDragon macrumors 603


    Mar 27, 2009
    The World Inbetween
    You have to make a special URL protocol like itms:// and steam:// and have a program on the client to have associations with protocol.
  4. magicleader thread starter macrumors newbie

    May 4, 2011
    Can I associate from itms and steam protocol an applescript program?

    Can I call itms or steam url from any internet browser?
  5. chown33 macrumors 604

    Aug 9, 2009
    on the Western Slopes, with E. A. Poe
    You can't run AppleScript provided by a remote computer. Period.

    If you could do that, it would be a huge exploitable security flaw. Any server anywhere on the internet would be able to tell any Mac OS X computer to delete any files on that computer, or upload them to any remote location. Big problem.

    You can't tell the client computer to install and run an application, either. That's just as big a security hole.

    And you can't associate a URL scheme to an arbitrary program. Yet another security hole.

    Since all these things are huge security holes, they are unlikely to be intentionally provided by any application vendor. This means it's unlikely that any approach involving remotely provided AppleScript will ever work.

    So instead of asking questions that will almost certainly be answered with "No, because it's a huge security hole", please explain exactly what you intend to accomplish by running a remotely provided AppleScript. Be specific: identify exactly which application you're trying to run. There may be another solution, but since we don't know exactly what you're trying to accomplish, we can't tell you how to go about solving it.

    If you're running a signed Java applet, you have access to the Runtime.exec() methods, which can run code provided by a remote computer. But you still need the user's permission to trust the applet, in order to gain access to Runtime.exec(). Signed but untrusted applets are not permitted to do this.

    Your target user must also have Java enabled in their browser. A significant portion of users have disabled Java, for one reason or another. In the past, there were some exploitable security holes in the browser's Java Plugin, and the simplest fix was to disable Java.
  6. magicleader thread starter macrumors newbie

    May 4, 2011
    Thank you for your reply.

    I tell you what is my problem.

    I have to istantiate MS Word from Internet browser using Javascript or applet or anything else, and I didn't know how to do this in Mac OSX.

    If I have to trust applet or javascript or anything else I will do it, and if I have to enable Java on the client browsers it isn't a problem.

    After istantiate MSWord I have also to download a file from a mysql database and copy it on MSWord I opened by browser.
    On the MSWord Document I have a custom toolbar that allows to save the document on the mysql database.

    I did it with Windows client using an ActiveX and I can open MSWord and download the file from mysql database using VBA code inside a MSWord template that I've previously installed on the PC.

    Can I do anything like I did for Windows in Mac?

    Now I'm trying to use a custom protocol like the previous post suggest me , if you have an another solution you are welcome

    thank you

Share This Page