How to get AppleScript to NOT show an error message when ...

Discussion in 'Mac Programming' started by ac3320, Nov 1, 2011.

  1. ac3320 macrumors regular

    ac3320

    Joined:
    Aug 20, 2011
    Location:
    CA
    #1
    ... When I have it set to try and auto-mount a network volume at startup.

    My script looks like this:



    I have an external USB hard drive attached to my AirPort Extreme and would simply like it to 1) auto-mount it when I re-boot/re-login and I happen to be on my home network and 2) when NOT on my home network, I don't want it to give me an error message like what follows; I just want it to close the application and leave me alone lol

    [​IMG]
    [​IMG]

    Hope someone on here can help me!
     
  2. ac3320 thread starter macrumors regular

    ac3320

    Joined:
    Aug 20, 2011
    Location:
    CA
    #2
    Update:

    So I did some more searching, and this is what I have so far:

    [​IMG]

    Seems there are a bunch of ways to do it, but i'm always for "the simplest is the best" (especially since i'm a noob). I tried this and i still get the error message saying:
    [​IMG]

    Anyone see anything that i'm missing?
     
  3. ac3320 thread starter macrumors regular

    ac3320

    Joined:
    Aug 20, 2011
    Location:
    CA
    #3
    Finding some more good stuff out.

    This page brought up the point that using the "mount volume" "handler" command will cause OS X to show the error dialog, even if my AppleScript is set to return (I have suppressed the AS error, just now the OS X one).

    The last post in that page suggested using some Finder commands. So I tried the following:

    [​IMG]

    (but am still getting an OS X error dialog)

    Am I messing up because the "tell" 'structure' (don't know the lingo) doesn't mesh with the "try" structure...? Shooting in the dark here...
     

Share This Page