Apple script constantly says can get end (-1728)

Hi,
my apple script always will say cant get end
Here is my script
set question to display dialog "Would you like to force empty the trash" buttons {"Empty", "Force Empty", "Cancel"} default button 2
set answer to button returned of question
if answer is equal to "Force Empty" then
do shell script "rm -rf ~/.Trash/*"
  if answer is equal to "Empty" then
  tell application "Finder"
  empty trash
  end tell
  end if
end if
should i try using the else function instead?
Thanks

Yes you should be using if else (or just else).
Looking at your code formatted like so
if answer is equal to "Force Empty" then
     do shell script "rm -rf ~/.Trash/*"
       if answer is equal to "Empty" then
            tell application "Finder"
                      empty trash
            end tell
       end if
end if
you can see that if the answer is not equal to "Force Empty" then the script just exits. The answer is never checked for "Empty"
So something  like
if answer is equal to "Force Empty" then
     do shell script "rm -rf ~/.Trash/*"
else  if answer is equal to "Empty" then
         tell application "Finder"
                empty trash
         end tell
end if
would be more correct. However two issues one you are not checking if the user presses cancel. And two emptying the Trash by doing a rm in the shell should not be needed. If it is you have other problems that should be addressed.
regards
  end if
end

Similar Messages

  • When I try to sign in to my Apple ID it says can't connect to iTunes

    My Apple ID is not working and when I try to sign in it says can't connect to iTunes.  

    Hey Ironjake88,
    I can see that you are experiencing an issue with your ability to connect to the iTunes Store using your iPad. Here is an article for you that will help you address this issue:
    Can't connect to the iTunes Store - Apple Support
    http://support.apple.com/en-gb/HT201400
    Thanks for using the Apple Support Communities. Have a good one!
    -Braden

  • HT204291 I am trying to play a movie from my ipone4s to my apple tv and I can get the audio but the picture will not play. What am I doing wrong?

    I am trying to play a movie from my iphone4s to my television using apple tv. I can hear the audio. It the movie picture will not play

    Welcome to the Apple Community.
    Where's the movie from.

  • I'm new to apple, and I don't know how to review my new apple ID, so I can get apps and songs

    I really want to tart getting some apps but when I do it's says I have to review my new apple ID to the iTunes and App Store. But I follow the instructions and then it's says I have to enter these billing information, but I don't want to buy anything so what do I do, I really want to start getting some apps but it won't let me

    If yo set up an account the normal way you have to add a valid payment method, like a credit card or redeem an iTunes gift card.
    Yo can however create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • Watched one episode, now says can get rest of season for reduced price but then does nothing...

    i clicked to buy a season pass and it said i could click complete my season to get a reduced price on the rest of the season. so i click on it and it just gives me the same page again. i click on buy season pass and it says now i'd have to pay regular price. so i cancel and go to the click here for available downloads and that goes to a page that has the complete my season at the top and is blank. next to a "sort by" button, there's a spinning circle like it's doing something but nothing happens. so can i get the rest of the season for a reduced price or not? and how do i do that? it shouldn't be this difficult, people, come on this is apple. help please.

    does this have something to do with the fact that i want standard definition and not hd cuz i'm playing it on my computer and don't want to have to pay more? n othing's downloading or happening. and i see no reduced price as the individual episodes are still $1.99 each.

  • I can't use my apple id it says can't use this apple id please enter another one

    I've even reset my apple Id but still says enter another id

    It's been reported that Apple's servers are having problems tonight. Just try again later.

  • After download newest itunes software itunes will not sync the music that i have on my dell to the apple tv however i can get the music i have purchased  from i tunes. Applet tells me i will have to reload all the music that was not purchased from itunes.

    After download newest itune software i am unable to sync the music i loaded from my personel cds from itune to apple tv however it loads music purchsed from itunes. Apple tells me i will have to reload approx 45 cds even thou this music shows up on the computer.  Dell computer  Windows 7.Any help

    Lavoice wrote:
    ..... Then  i scrollover to computer and it will not download librairy Home sharing is on
    This is a problem with home sharing, you are not going to have to re-encode all your CD's.
    The following article(s) may help you.
    Troubleshooting Home Sharing
    Troubleshooting Wi-Fi networks and connections
    Recommended Wi-Fi settings
    Wifi Diagnostic Software (for Mac users)
    You may also find some help on this page, where I’ve collected some of the more unusual solutions to network issues.

  • Exclamation Mark or Apple Sign all I can get

    Please help! My iPod froze and now when I try to turn it on, all I see are the Apple sign alternated with the Folder with an exclamation mark icon. I have tried to reset the iPod by pressing the Menu and the Play/Pause button. I have also tried to reset it by pressing the Menu and the Select button (I have a third generation iPod about 2.5 years old). It hasn't worked, any other ideas please?

    See these.
    iPod shows a folder icon with exclamation point after disconnecting.
    iPod shows a folder icon with exclamation point when you turn it on.
    See also.
    iPod shows only an Apple logo and doesn't start up.
    Only the Apple logo appears when turned on.
    How to reset the iPod if it appears frozen or doesn't respond.

  • Can't get end...Help?

    What Have I Done Wrong?
    I appreciate that I am not the best coder in the world. In fact I have only just started coding. I know my Script could be better and that there are some, shall we say, rough edges. I wrote this Script to automatically check for updates because  OS X is not doing so. OS X Yosemite(and Mavericks before it) would do so manually but not on it's own accord. This despite me having all setting turned on, deleting and rebuilding the necessary files and reinstalling from scratch OS X.
    Anyhow here is my Script, perhaps someone could tell me why when i run it as an Application it runs then says Can't get end -1728
    thank you
    tell application "Finder"
      set myfile to "/Library/preferences/com.apple.SoftwareUpdate.plist"
      if not (exists POSIX file "/Library/Preferences/com.apple.SoftwareUpdate.plist") then
      display dialog "I am sorry but the file Library/Preferences/com.apple.SoftwareUpdate.plist does not exist"
      end if
    end tell
    set sourcepath to POSIX path of myfile
    do shell script "cp -r " & sourcepath's quoted form & " ~/Desktop/"
    do shell script "plutil -convert xml1 /Users/touchdown/Desktop/com.apple.SoftwareUpdate.plist"
    set myfile to "Users/touchdown/Desktop/com.apple.SoftwareUpdate.plist"
    set thetext to (read myfile)
    delete POSIX file "/Users/touchdown/Desktop/com.apple.SoftwareUpdate.plist"
    end
    tell application "System Events"
      tell property list file myfile
      tell contents
      set automaticcheckenabledcopy to value of property list item "AutomaticCheckEnabled"
      if automaticcheckenabledcopy = true then
      do shell script "softwareupdate -l"
      end if
      set automaticdownloadcopy to value of property list item "AutomaticDownload"
      if automaticdownloadcopy = true then
      do shell script "softwareupdate -d"
      end if
      set configdatainstallcopy to value of property list item "ConfigDataInstall"
      if configdatainstallcopy = true then
      do shell script "softwareupdate -i --install -a"
      end if
      set criticalupdateinstallcopy to value of property list item "CriticalUpdateInstall"
      if criticalupdateinstallcopy = true then
      do shell script "softwareupdate -i --install -r"
      end if
      end tell
      end tell
    end tell
    tell
      end tell

    No Offence but I have looked there already. I have done the following
    1) checked the settings are turned on in System Preferences/App Store
    2)Checked the file /Library/Preferences/com.apple.SoftwareUpdate.plist is there and also that it has the relevant settings turned on
    3)I have deleted the above file then gone back into System preferences/App Store and turned the settings off then on to rebuild the above file.
    4)I reinstalled OS X Yosemite
    5)I reinstalled OS X Yosemite from scratch (clean install)
    6)I created a brand new Apple id and used that to log in with in case it is somehow my id
    7)I followed Apple's steps to bypass proxy Server settings as in some cases if your internet connection goes through a proxy/secure proxy server and the traffic is inspected then the connection to apple's update serves is no deemed secure and no effort made to check for updates. Once i followed Apple's steps to the letter it still does not work
    8)Tried logging on to various other networks
    9)Made sure all software/apps/OS X is unto date
    10) When I reinstalled OS X Yosemite I did not restore from backups and just started fresh in case it was an app/software
    So you can see I have done practically everything I can think off to solve the issue. This is why I think it is more endemic than simply something I have done. My Girlfriend also has the same issue as me so the chances of both of us doing the same thing wrong (with nothing we do working)is remote.
    I am thinking that the problem must be Apple's end on their servers as I do not think it is a problem with the OS or lots more people would have the same issue and it would be more wide spread than this.

  • HT4993 Forgot apple password, changed it my wife can get into on her phone and on the ipad but I cannot get into the apple account from my phone. What do I need to do?

    We forgot Apple password, changed it. I can't get into Apple but my wife can get into it on her iPhone 5s and we can get into it on the ipad but I can't on my 4S. Any suggestions?

    Hello there, pacase1.
    From what I understand you've changed the password but can't login to a particular feature on your iPhone 4s. If that is the case, the following Knowledge Base article provides some good pointers to use depending on which feature/service you're trying to sign into on your iPhone:
    Apple ID: What to do after you change your Apple ID
    http://support.apple.com/kb/HT5796
    If the issue is still with your password, feel free to review the following documentation:
    Apple ID: If you forget your password
    http://support.apple.com/kb/HT5787
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Running an apple script from excel

    I have been trying to find some visual basic code to run an apple script from an excel workbook for weeks now, but after searching everehwere online and asking in multiple excel forums I have yet to find an answer. It appears it should be possible (as windows users of excel are able to do it, although running different files not apple scripts), but I cant get it to work on a mac, and I have not been able to come accross someone that is running excel on OSX that has an answer. Hoping I can find some mac excel users with apple script and visual basic knowledge here that might have an answer.
    This is a link to the question I posted on excel forum a couple of weeks ago:
    http://www.excelforum.com/excel-programming-vba-macros/962375-vb-code-to-run-a-f ile-on-mac.html

    I use http://macchampion.com/scenario_features.shtml
    dual-core G5/2.3   Mac OS X (10.4.6)   dual screens

  • Apple Script to dismiss UPS alert

    I am using my Mac Mini as an entertainment center (no keyboard). I use Sofa Control & a Harmony one remote. Works great, except: I have a ups on the Mini, as in Fla we have daily power outages. As a result, often, when I turn on the PVR activity I am presented with the ups warning dialog box which overlays the video & turns off the sound. I can use the keyboard to dismiss the alert but it is quite inconvenient. I would like to have an apple script which I can install in Sofa Control to dismiss this alert, or just as useful would be having the alert not appear.
    Any suggestions would be appreciated.

    I have two answers, one of which is scary.
    scary one first (because it is more directly relevant to the problem, and easier)
    there is a script located at /usr/libexec/upsshutdown.  if you open this in TextWrangler or any other plain-text programmer's editor (do NOT use a rich text editor or an editor with a proprietary format schema like MS Word or Pages), you'll see at about line fifteen a line that says:
    logger -i -p daemon.emerg -t UPS "${MSG}"
    the -p daemon.emerg bit - so I'm guessing - sets the priority of the message to LOG_EMERG, which would basically broadcast it to everyone like a kernel panic.  I think that's the source of your pop-up alert.  I believe if you change that bit to read, for instance, -p LOG_WARNING or -p LOG_NOTICE, it will write the event to the system log but not present it as an alert.  I have not tested this, so make sure to make a backup of the upsshutdown file before you edit it.
    less scary one
    If you install sleepwatcher (available here) you can run scripts at system startup - that would make it conceivably possible to test for and dismiss a modal window that onscreen at startup.  that would take some testing, however (we'd need to discover which process is presenting the alert, first, and work from there). Unless you're really averse to the scary option, try that first with all due caution.  if it fails, we can try something else.

  • When I can get MirrorLink App for my Iphone 4S?

    Hello,
    in my car is a Sony XAV-601BT Radio in it. You can use with the radio a Smartphone with the APP MirrorLink, than you can see all your Apps from the phone on the mirror of the radio.
    But it is noch nice, that I can´t find the APP
    MirrorLink
    noch on the App-Store from apple.
    When I can get it there?
    Greetings
    Stippi

    Apple has developed Siri Eyes Free, which many auto manufacturers are already supporting, so I doubt you'll see support for MirroLink, but you can suggest such to Apple here:
    http://www.apple.com/feedback/iphone.html

  • Is there anywhere in the UK i can get replacement rubber feet for my 2009 macbook pro?

    Hi All,
    my feet have fallen off   is there anywhere i can get rplacement ones or are there any contact details to go straight to apple?
    Ta
    Mark

    You can get them from any Apple Store or any Apple Authorized Reseller or Repair Centre.
    I had to replace the bottom feet of my late 08 Macbook Uni and went to an Apple Store in my area and they just gave it to me.  Mind you, not all Apple Stores will give it to you for free.
    Good luck

  • I am trying to load a 2006 package in cd form onto my apple mac when I try and down load it it comes up in like foreign script, and says does not operate dos, can anyone help I am a lot of a novice. grateful - Carol

    Yes Im a lot of a novice so be patient with me lol I am trying to put a 2006 Edition of a weight programme on my laptop, but when I down load it it just comes up in weird script and says cannot operate in Dos mode can anyone help.
    Thanks

    Welcome to Apple Support Communities.
    Sounds like you have a program designed to run on Microsoft Windows, or even older (1980's) MS-DOS, rather than Mac OS X. If you have Windows on your Mac installed via Boot Camp, try booting into Windows first, and then loading the CD.  If you don't have Windows, it's probably cheaper to buy a new program designed for Mac than to purchase a copy of Windows (US$120 or more), not even knowing for certain if your old program will run.

Maybe you are looking for

  • Can I Export to Text File?

    hi, can i export my ical events to a text file? thanks. samantha

  • Check Box item in oracle forms

    Hello experts,               I am new in oracle forms. I am using oracle forms 11g,weblogic server 10.3.5,oracle database 11g at windows 7 platform. I have a simple data block from base table.there is a tabular form is selected, It has four rows(reco

  • Looking for advanced Swing training/courses

    Hi, I am looking for compagnies/trainingcenters which have advanced swing trainings. Many have swing courses but after working pretty extensive with swing for a year now, I dont think those will be usefull. I'm looking from a course which handles adv

  • HOW DO I UNINSTALL osx; 10.9?

    It wont support parallels

  • Options for Managing Library on Network

    Hello all, I'm wondering what options I have in managing an iPhoto library over the nework. Currently, my wife and I have our own MacBooks and have our own iPhoto libraries. We want to consolidate the 2 libraries to just one and access it on the netw