AppleScript's "try" command gives up too easily.

I want to do some conditional branching using "try." For the record, there is no user on my computer named "Batman." I want the script to continue even if it doesn't find a user this time.
Here's my code, in Snow Leopard 10.6.8:
try
          do shell script "dscl . -read /Users/Batman"
on error 56 -- which reads "error "<dscl_cmd> DS Error: -14136 (eDSRecordNotFound)" number 56"
--keep going; "Batman" is only one of a number of user names I am testing!
end try
The script fails and exits with a message that reads:
AppleScript Error
<dscl_cmd> DS Error: -14136 (eDSRecordNotFound)
I thought the whole point of "try" was that it would allow your script to continue running even if it ran into an error...? 

This isn't the code I need to run. I am testing a list of usernames to see if the accounts exist on our Active Directory domain. I used this code because it fails to work just as well as the real code, and I don't want to limit my pool of genius lifesavers only to people who are bound to Active Directory.

Similar Messages

  • HT201365 How do I download Whatsaap, Facebook and Skype into my home screen. When I try it gives me an erros message saying that this is not available in a Panamanian store and I live in the US. HELP????

    How do I download Whatsaap, Facebook and Skype into my home screen. When I try it gives me an erros message saying that this is not available in a Panamanian store and I live in the US. HELP????

    Change your country on iPhone, iPad, or iPod touch
    Tap iTunes Store, App Store, or iBooks Store.
    At the bottom of the Featured page, tap Sign In.
    If you're already signed in, skip to step 5.
    Tap Use Existing Apple ID.
    Enter your Apple ID and password and tap OK.
    Tap your Apple ID.
    Tap View Apple ID or View Account.
    Tap Country/Region.
    Tap Change Country or Region.
    Tap the Store menu and tap your country.
    Tap Next.
    Review the Terms and Conditions and Apple Privacy Policy.
    Tap Agree if you agree to the terms and conditions.
    In the prompt that appears, tap Agree.
    Select a payment method and enter your payment information.
    Enter your billing address and tap Next.

  • Run-after: handy command to schedule jobs easily

    Hi All
    I've created a declarative command to schedule jobs easily, like below;
    $ run git push origin master after 5 minutes, 30 seconds
    Here it is: https://github.com/azer/run-after
    To install:
    $ npm install -g run-after
    Ideas and recommendations welcome!
    Azer

    60 % of characters, same result:
    sleep 5.5m; git push origin master

  • 11g asm cp command gives ASMCMD-08202: internal error: [asmcmdshare_error_m

    Subject: 11g asm cp command gives ASMCMD-08202: internal error: [asmcmdshare_error_m
    I'm having problems using the 11g cp command to copy a remote asm file:
    ASMCMD [+] > cp DBQNL8_G1_DATA_AREA/admt/parameterfile/spfile.325.678643027 [email protected]_dbd0121:+DBDNL2_G2_DATA_AREA/ditob/tmp/spfileADMT.ora
    Enter password: ***********
    ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]
    E: amscmd failed
    The source and target asm are 11g, databases ditob en admt are 10.2.0.4.0.
    Any help would be appreciated.
    Regards,
    Tim

    Yes:
    target and source are RAC databases in asm.
    sourcedb ORACLE_SID=ADMT1
    sourceasm ORACLE_SID=+asm_dbq0125
    targetdb ORACLE_SID=DITOB1
    targetasm ORACLE_SID=+asm_dbd0121
    target service_name = ito.b.de.grid
    target ldap_name = ito-b-de-grid
    ASMCMD [+] > cp DBQNL8_G1_DATA_AREA/admt/parameterfile/spfile.325.678643027 [email protected]:DBDNL2_G2_DATA_AREA/ditob/tmp/spfileADMT.ora
    Enter password: ******
    ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]
    E: amscmd failed
    ASMCMD [+] > cp DBQNL8_G1_DATA_AREA/admt/parameterfile/spfile.325.678643027 [email protected]:DBDNL2_G2_DATA_AREA/ditob/tmp/spfileADMT.ora
    Enter password: ******
    ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]
    E: amscmd failed
    ASMCMD [+] > cp DBQNL8_G1_DATA_AREA/admt/parameterfile/spfile.325.678643027 [email protected]:DBDNL2_G2_DATA_AREA/ditob/tmp/spfileADMT.ora
    Enter password: ******
    ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]
    E: amscmd failed
    regards,
    Tim

  • HT1338 i will like to update to Mac OS v10.8, when i try, it gives responding product distribution could not be verified, maybe damaged or not verified. please, help

    i will like to update to Mac OS v10.8, when i try, it gives responding product distribution could not be verified, maybe damaged or not verified. please, help

    Make sure your Mac qualifies to upgrade to Mountain Lion >  Apple - Upgrade your Mac to OS X Mountain Lion.
    Installing the OS X Lion Update 10.7.5 (Client Combo) reinstalls the App Store for you which may help the product distribution error.
    Restart your Mac after the combo is installled. It's ok to do this even though your Mac already has v10.7.5 installed.
    Then try downloading Mountain Lion.
    FYI ... For downloading Mountain Lion from the App Store, a high speed (broadband) internet connection is strongly recommended by Apple as noted here > iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
    You may also need to temporarily disable anti virus software if installed.
    Apps such as Little Snitch, Net Nanny, and Hands Off can prevent apps from downloading including Mountain Lion.

  • HT5429 unable to use MAPs in india as well as Middle east - When I try it gives pop up message - cannot provide directions. The map server is not available

    unable to use MAPs in india as well as Middle east - When I try it gives pop up message - cannot provide directions. The map server is not available

    Here:
    http://support.apple.com/kb/DL907?viewlocale=en_US&locale=en_US

  • My iPhone 4 I can not activate and when you try to give me a message for activation activation can not now try later

    my iPhone 4 I can not activate and when you try to give me a message for activation activation can not now try later

    What is the exact wording of the error message?
    Is there a sim in the iPhone?
    Has the iPhone been jailbroken or modified to work with
    other than the original wireless provider?
    Did you recently restore the iPhone or update the iOS version?
    What cellular provider in which country are you attempting to use
    the iPhone with?

  • Bluetooth keyboard turns on too easily

    I'm loving the bluetooth keyboard in conjunction with my iPad, but I have one problem with it: It turns on too easily when it gets bumped. This happens a lot when I carry it in my bag, which is a tight fit. With the switch right on the end, and not recessed at all, it turns on if it hits the bottom of my bag, or if something bumps it.
    It would be better if there some sort of lockout on the power switch. I think the ideal would be to have a raised ridge on the switch where the user has to turn it (maybe 90 degrees) before it can be pushed on to switch on the keyboard. At the very least, the switch could be recessed.
    It's fine as-is for use on the desktop, but the design isn't considerate of on-the-go users who pull it in and out of carrying bags. Otherwise, it's the best keyboard I've used. It's a pleasure to type on it.

    I was just researching the same problem and found this info :
    "I figured it out, i had "mouse keys" on.
    To fix go to Preferences>Universal>Mouse> MouseKeys and click off"
    sure enough I had the 'mousekeys' on and turning it off - keyboard now working
    hope this works for you

  • While playing music in iphone, the view switches too easily to landscape

    While playing music in iphone, the view switches too easily to landscape. All I have to do is rotate the Iphone by what seems like only a few degrees, and it gets stuck in landscape (cover art) view. To get it back in portrait (current track) view, I have to rotate it again. Is there a way to get rid of the landscape view? I hardly ever want to see cover art not related to the current track.
    Thanks
    from Pittsburgh

    lol.
    I meant that it barely takes a tilt for it to turn. For example, if I'm wearing it on a belt clip. Is there a way to adjust the sensitivity?

  • Whenever i try to pin or try to give some effect on text or shapes it automatically got invisible !!

    Hello,
    I dont know what is wrong with my muse. One more problem, whenever i try to pin or try to give some effect on text or shapes it automatically got invisible !!! even do in master page or in home page it got invisbile. Please help me out and why this is happening to me. I am sick and tired of all trouble now.............

    A friend of mine called me today with the same issue. No idea how to resolve this, never heard of it before. She has a message that she used to forward before now permamently stuck. Even when she selects some other message to forward, that old text appears instead, thus making FW-ing unusable.
    Really weird.

  • Magnetic AC Connector Too Easily Dislodged?

    My MB Pro is my Desktop or primary computer. I tend to use it while in bed or sitting on a couch ( with my MB Pro sitting atop a platform that straddles my lap. I mostly power it via the AC adaptor.
    I've found that the magnetic AC connector dislodges way too easily;
    I often don't notice that the connector has been dislodged until the battery is nearly out of "juice". Possibly, an optionally set audible warning or "in your face" visual warning on one's screen would be helpful, here.
    What are your opinions of the magnetic connector....too easily dislodged or never a problem?

    The magsafe adapter has saved my laptop from taking a dive several times. Think of it this way: those times that your magsafe became dislodged could have resulted in strain and eventual damage on a conventional jack, so it's doing a good job!

  • How to run an applescript using unix command

    Hi All,
    Can any one help me in giving me the command for running an apple script thru postupgrade shell file in other words i wana run an apple script while running my new installer that will upgrade the old version of application but while installing i want to run an applescript so as i know ill have to give that applescript path in the postupgrade script but how to run it while installation and where to keep it (is it postupgrade). May be in short how can i run apple script thru unix command.

    Use the osascript command.
    In my installer, I use the DropDMG program to build my DMG disk image. It doesn't quit automatically, so I have to do the following:
    osascript -e "tell application \"DropDMG\" to quit"
    Type "man osascript" for more information.

  • Applescript: terminal unrar command

    Hey,
    I would like to know if it's possible to make an applescript of the following terminal command(s).
    cd
    unrar e -r -o- *.rar && find ./ -name “*.r*” -delete
    Also, I would like to know if it's possible to tweak the "unrar e -r -o- *.rar" command.
    Following situation:
    Main_folder\SubfolderA
    Main_folder\SubfolderB
    Main_folder\SubfolderC
    when I login in to terminal and use the command => unrar e -r -o- *.rar
    Everything from SubfolderA / SubfolderB & SubfolderC will be extracted in Main_folder
    Now my question is: Is there a command that will extract the "*.rar" in the same subfolder as where they are stored.
    Kind regards,
    Maxime

    Hi Frank,
    I try to unrar .rar files.
    I've managed to tweak my automator script:
    on run {input, parameters}
      tell application "Terminal"
      activate
      do script with command "cd /Volumes/****_storage/Downloads && unrar e -r -o- *.rar && find /Volumes/****_storage/Downloads -name *.r* -type f -delete"
      end eend tell
    eenend run
    The the subfolder remains an issue.

  • Applescript "do script" command

    I am having trouble with the do script command in applescript.  I am working with Acro Pro 8.
    This is the script...
    tell application "Adobe Acrobat Professional"
         tell active doc
              do script "this.getField(\"AE\").value"
         end tell
    end tell
    This is the error...
    Adobe Acrobat Professional got an error: "this.getField(\"AE\").value" doesn’t understand the do script message.
    I can get it to work by making it a file but I also need to pass a variable to Acrobat and would like to do it this way.
    Have any of you gotten this to work or have experience with the command.

    I tried it with single quote and still did not work.  I put this.getField('AE').value into the javascript debugger and I get what I expect but I just can't get it to work in applescript.
    Note: I tried it with Acro Pro 7 but get "undefined" not the value. (osx 10.6.2)
    I also tried it in osx 10.4.11 with Acro Pro 7 and it did work.
    I really need it to work in osx 10.5 which with Acro Pro 7 gives me the same "undefined", no value, and errors with Acro Pro 8
    I don't know how to make sense of this??

  • I can't listen to at least 100 of my songs on itunes. When I try it gives me a message that it can't play that song because the original file could not be found. Would you like to locate it? What do I do?

    When I try to listen to certain songs a message pops up that the original file could not be found. Do you want to locate file? I don't know how this happened and I don't know what to do. I have tried repairing Itunes and also uninstallng and reinstalling. I have restarted my computer and even done some troubleshooting. When I tried hooking my ipod up to my computer to see if that would help I got a message that said "At least 100 songs could not be transferred, including "You found me."" I have no such song in my itunes. Can itunes get a virus?
    Does anyone have any ideas what I can do? I'm at a loss and would really like my itunes to be back to normal.

    I was not complete clear.
    Since you never changed the settings in the advanced section of iTunes preferecnes, you have to chech that your music is really in the location setted in the folders reported in the advanced section.  If not you have 2 ways: reset the position of this folders or in the actual disk organisation or in the pointing on the preferences.
    If you press the reset button you just give to itunes its default setting as for the position of the music files: probably this will be a good choice if you have never changed any default preference.
    But before I would check the folders and see if the songs are really there
    In my iTune I have this, and I believe it is the default.
    Users/YOURHOMEFOLDERNAME/Music/iTunes/iTunes Music

Maybe you are looking for

  • Mac Pro Kernel Panic while booted on install disk

    I have a Mac Pro with 1 year and 2 weeks on the clock. No Apple Care. Started getting intermittent Kernel Panics about 2 weeks ago, which are becoming a real problem now. Happening every time I use the machine. I’m running 10.6.4 and just have the or

  • I cannot download all of my available downloads

    I receive the error: Unable to check for available downloads. The network connection was reset. I can download the files that have been available to me for a while, which i dont want to download, but the files I am looking for (application updates an

  • Macbook Pro 15" high-res 1440 x 900 setting using SwitchResX

    Hi, I have Macbook Pro wiht15" high-res display. But I seems I can set the 1440x900 resolution by default option. There is only 1440x852... thouth I can't understand it. Anyway, someone seems to enable 1440 x 900 resolution with SwitchResX. I also tr

  • PSG Settlement KE338 Error Message in to Warning

    We have not activated the COPA in transaction KEKE. but still we want to Enter settlement rule as PSG [Profitability Segment] in Internal Order Settlement and WBS Settlement. While Entering PSG Settlement Rule we are receving an error message KE338 .

  • White spot on screen

    Hey! I got a problem.. When I press the home button a white spot appears on my screen, like a blur. And desapears in 2 seconds. My iphone has never crashed or had contact with water. What should I do?