Programming "BACK" with Applescript

Discussion in 'Mac Programming' started by Jetheat, Mar 19, 2008.

  1. Jetheat macrumors regular

    Mar 13, 2008
    I have no programming knowledge but I do know that I'd like to assign a BACk button to my Mighty Mouse.

    It seems that the only way to do that is to make a Applescript which takes a user back to the previous page (regardless of the application).

    I need some help to do this as I don't have a clue of how and where to start.

    Appreciate the help,

  2. DTG macrumors member

    Oct 5, 2003
    I use USB Overdrive X. It checks out all the buttons available on your input device (in this case your Mighty Mouse) and let's you assign commands/keystrokes etc to each of them. I use it with my 9-button Logitech mouse - works a charm.

    I recommend you give it a try.
  3. Jetheat thread starter macrumors regular

    Mar 13, 2008
    Yeah, USB Overdrive is great.


    But is it just as easy to program Back and Copy into Applescript?

  4. numero macrumors regular

    Jul 23, 2002
    I think you would find an AppleScript solution to be slow. If I am understanding this right, you want a mouse click to activate an Applescript. The amount of time it would take the script to launch would be measured in seconds (not milliseconds).

    You might be able to do event handlers in the script. In this case the script would always be running and then the handler would get called. The downside here is that this script (application) will always be running and would show in the dock.

    Also, I get the impression that you want this to act on more than just a web browser. The script would have to have logic in it that detects the front-most application and then there would have to be code specific to that application in the script. This assumes that the application you are using is either AppleScriptable or that you can use UI scripting on it.

    I think it would be a lot of work and may not give you the results you expect in every application. Picking out just one application, say Safari, and trying to get this to work might not be a bad learning experience. I'm pretty sure you will need to resort to UI scripting to click "Back" for you.

Share This Page