Best way to manage an "Esc" pressed by the user

Hi friends
I normally create dialogs to offer options to the user before executing the script functions. So, having a "Cancel" button in this dialog would suit the need for an user to cancel the operation.
But let´s say the user selected the options in the dialog and pressed button OK to start the execution of the process. The dialog will close and process will start. Suppose it will take 1 minute to complete.
If, inside this 1 minute, the user presses "Esc" key in keyboard, then the execution will stop, but it will display an alert (like an an error) it was not possible to finish the process (sure, he cancelled the operation).
What I want to understand: Is it possible to manage this "cancellation" of the user via the ESC and do not display alerts? For example, write a function that tells...If user presses "ESC", then abort the process and display no dialog.
Would an event listener that reads the keydown "ESC" would be suitable for this task? or is there any simpler or suitable way to do it?
Thank you very much for the tips.
Gustavo.

I don't think it is possible with javascript. I don't know about other languages.
Because the esc key also can be used to close a dialog, while the dialog is open you can write an onClose event handler to try to add clean up code. It should work if the user only presses the esc key once. But if they press more than once or hold down the esc key the script will stop before the handler is done. In other words the first press closes the dialog( running the onClose event ) and the second press stops the script. Even a keyboard event handler inside the dialog of the esc key can't keep repeated presses from stopping the script. At least I have not found a way and I spent a good bit of time trying.
Once the dialog is closed or if the script doesn't use a dialog the first esc key press stops the script. There isn't an event for esc that can be used by the scripts event manager or app.notifiers. But even if there were I think it would have the same behavior as the dialog onClose.
I can understand why esc stops the script regardless of what the script wants to do. After all the esc key is the user's 'panic button' when they think something is wrong. I am not sure having a way to ingore a user's request to 'stop now' is a good thing.

Similar Messages

  • Best way to create a conact list from the user profile properties

    We have a customer looking for a phone book utility, starting with a table showing main user information and with some search options. We would like o base it on the user profile properties and not to create an indipendent studion record browser porlet.
    What is best way to create a conact list from the user profile properties ?

    I did something like this using search.  It can get messy, so you need to take care with it.
    * Identify the properties you want to make accessible to search (ex: name, etc.)
            - add them to the user property map
            - flag them as searchable
    * I broke down and used the native server API.  I'd still suggest this approach.
    * Write some simple code to do vcard export if you like
    (my code is all in vb.net)
    I really believe this is the "right" approach, but honestly, this was a bit painful and has been
    messy for us given some other business issues.  (to my chagrin we have users with 2-letter last
    names...)
    I have code you're welcome to poke at, but it's more or less slapped together and has various
    different search methods commented out so you can see how I tinkered w/ the remote vs. server
    API.
    If you'd like it mail me at [email protected] and I'll send you a zipped copy w/ a
    readme.  I hope it may be useful to you as both a starting reference.

  • Best way to manage media (photos/music/videos) across user accounts in Lion?

    Yesterday I clean installed Lion. I copied only that what I need from my TimeMachine backup. The apps were reinstalled as well. Now, I've set up iPhoto to link to my library in the Users>shared folder so that its available across all user accounts shared with my family members. Same is the case with iTunes library. But with integration with iCloud and @me.com or @mac.com accounts, I'm not sure how each one of us can have out own accounts configured in these libraries while they are shared. Keeping this in mind, what is the best way to share music, videos and photos across user accounts and yet have the apps... iTunes, iPhoto, etc, know our individual settings in out respective user accounts?
    For iTunes should I just create a referenced library? Will that let me sync my photos and videos to my iPhone 4? If so, how?
    For iPhoto I guess i''ll have to create separate libraries for each user account and then have one common for our shared photos. But thats just plain complicated for users who aren't tech savvy in my family.
    Please advice before I create a mess with my media again!

    Thanks for the idea, but that strategy introduces problems of its own. Now I have two iPods (a 5G and a touch) that sync with one library and an iPhone that syncs with another. This makes my life workable on the road, but at home, it means I have to change iTunes libraries when I sync different devices. It also means that, when I download new content, if I want to take it with me on my MBP, I have to synchronize it between two libraries. That sounds like an ugly situation.

  • What is the best way to manage my dvd's with the Apple TV

    Hi,
    I might be in the wrong category/subforum, but I dont really know where to post my question exactly.
    A few months ago I bought my first MBP after owning several ipods, iphones and ipads, an Apple TV and an Airport Extreme.
    My wife and I have several DVD's stored on our shelf, but I want to have them in my library to make sure we won't lose the classics or damage them with a scrath. For this I am converting them to MP4 format so they will be importable into iTunes, but here is my question:
    Since we have a lot of DVD's I want to convert, my hard disk wont be able to store all dvd's along with my documents and music, so I was wondering if there is an option to connect an external hard drive to my Airport Extreme, store all MP4 files on that hard disk and make a direct connection to my library so I can stream them from the hard disk to the Apple TV or MBP.
    Since I'm quite new to the real iOS experiance (I'm a formerly windows user), I'm still trying to explore the features and posibilities. If anybody knows a better way to convert DVD's to a hard disk, preserve space on the MBP but have the option to stream to other devices, I am all ears

    As long as it is pointed to iTunes it will be accessible via home sharing on Apple TV.
    http://support.apple.com/kb/HT1751?viewlocale=en_US&locale=en_US
    If these are commercial DVD's we can't comment on any conversion process.

  • What is the best way to manage multiple ipods using the same itunes?

    Hi Everyone
    i am trying to manage three different ipods through the one Itunes, all with very different tastes, not sure if I am doing it the best or easiest way so does anybody have a simple solution on what you're supposed to do, to keep it all simple!
    Cheers
    Liv

    If you have created a new Windows user account you need to log out and then log back in with your original user name. By default each Windows profile will have an independent iTunes library.
    If instead you managed to create a new library within the same profile. click the icon to start iTunes and immediately press and hold down the shift key, keep holding until asked to create or choose a library. Click Choose and navigte back to your original which should be at <User's Music>\iTunes.
    Your question as posed was:
    What is the best way to manage multiple iPods using the same iTunes {library}?
    in which case Selected Playlists is probably the best approach. Simply create a playlist for each device, Alice's iPod, Bob's iPhone etc. and sync the device with the appropriate list.
    tt2

  • What is the best way to manage multiple devices with one iMac - different users with seperate itunes accounts or one mac user with different itune logons and libraries?

    Hello
    I have just purchased an imac which I am very happy with.  In our household we also have two iphones (one mine and one husbands) and one ipod (my sons). We all have individual itunes accounts set up on our previous computer (not a mac). We have sepereate apps and music, although there may be the odd occasion where we would like to share a song (if this is possible) across devices.
    I am just wondering the best way to manage these devices using the new imac.  Should I create individual accounts to logon to the imac, then from within these launch our own itunes accounts and sync our devices with these.  Or should I be using one version of itunes, logging on to this with our different itunes usernames and storing things in libraries.
    Any help would be greatly appreciated. 
    Thanks

    I am presuming that we cannot share downloaded apps and music between accounts because of the copyright issue,
    Though I'm no copyright lawyer, as long as it's within a household, you can share content among users. Such sharing is, absent specific language preventing it not present in the iTunes Store terms of use, generally considered to be "personal use". So you can share apps and music amongst your users on your computer and with their devices. You just can't give any of that content to friends or relatives who don't live with you.
    What I am not clear on, it making sure that this appears in each itunes account - is it easy to find the file storage folders that match the itunes accounts and what would these be?
    The iTunes library and files are by default in a user's Home/Music folder. But you don't have to find the folder; in fact putting a file into the folder yourself won't add the file to iTunes. Just drag the file into the iTunes window. iTunes will copy it to the correct location.
    Regards.

  • What's the best way to manage Apple IDs for multiple devices?

    Hi,
    We have
    a shared Macbook air
    a shared iPad
    my iPhone
    his iPhone
    We want to put one ID on the Macbook and iPad that we can use to have the same iMessage on both and that we can put a card on and use in the iTunes store etc.
    We also want to have our own iMessages on our iPhones, plus be able to use the account with the cards on them to purchase and share across devices...
    What's the best way to manage them all?

    Welcome to the Apple Community.
    iTunes is straight forward, just use the same ID on all of them.
    What exactly do you want to see in messages on the Mac and iPad, messages combined from each of your phones or a different account just for both of you.
    You should think about what you want in calendars, contacts etc, on your shared devices.

  • Best way to manage multiple iTunes accounts (from different countries)

    Ok, wasn't sure if this was the best community to ask this question, but here goes.
    My wife and I have two iTunes accounts, one originally from the United States, the other originally from Australia. Over the years content has been purchased using both accounts.
    We currently reside in Australia and primarily view our content on Apple TV. So far we’ve had no problems logging into either account and accessing all our content.
    Now, I have a fear (perhaps an irrational one) that if we choose to permanently reside in one country (Australia, the US, somewhere else) that at some point Apple may cancel/restrict one of these accounts. Since there is no way for me to merge all our purchased digital content into the one digital library, we’re now wondering the best way to manage this?
    I see there is a new "family sharing" feature soon to be launched, so that may be half the solution (assuming it will work with family members in different continents). If so, the other half of the question is, will we be able to still purchase content on both accounts? While in Australia since April we have rented movies on both accounts, but have only purchased movies etc on the Australian account (we can still do this on the US account, but we haven't risked it in case it gets cancelled because Apple decides we're no longer in the US - in other words, we don't want to spend $$$ on movies we may not be able to access in future).
    What do others think? What is the best way for us to manage our scenario? Or am I worried about nothing and we can continue purchasing content on either account without fear of “losing” it later?
    Any advice would be greatly appreciated! I did try and ring Apple, but the guy refused to give me advice until I provided my details and I did't want to do that at this stage.
    Thanks everyone for your help!
    MM

    You may lose the ability to purchase content from the USA, but any content you've already bought will remain accessible. Back everything up.
    (112502)

  • How is the best way to manage the stats table?

    Hello!
    I have the Integration 2.1 working with an Oracle 8.1.7 db. I noticed that the table
    STATS is growing pretty fast.
    How is the best way to manage this table?... I haven't found something related with
    this issue in the documentation, but at least I want to know how to safely delete
    records from this table.
    For example, if I know the minimal time I have to keep in the table, is quite simple
    to create a shell script and/or Oracle pl/sql job to trim the table.
    I hope somebody can help me!!!!
    Thank you!
    Ulises Sandoval

    Write an app people want to buy and rate highly.

  • What is the best way to manage photos - Dropbox (with sync), Facebook (with sync), iPhoto, etc.?

    With so many cloud based and wireless syncing services, I'm lost as to the simplest way to keep photos sync'd as well as backed up. My dropbox is currently syncing all photos I take with my iphone, but in an overall folder called CAMERA UPLOADS, so they are uncategorized. I upload pics to facebook, which facebook also has a sync photos feature, but I don't necessarily want all photos uploaded to facebook. What has worked best for everyone so that there aren't a ton of dupicate photos everywhere, and multiple syncs of the same photos?
    Also, what is the best way to manage my iPhone photos generally? I'm never sure if I delete a photo from my phone, does it delete it on my computer via iCloud? Sometimes I just take a picture to send to a friend that I don't need to keep, while others are ones I want to sync to my computer. Can I control when deleting that it be deleted everywhere or just on the device? And alternately, can I choose certain photos not to sync via iCloud?
    iCloud makes me nervous. Once when I wanted to place all photos of my pup into a folder, I selected the photos on my iPhone and accidentally clicked delete instead of move. No big deal, I figured they'd be at home sync'd on the cloud. But since I'd deleted them on my phone, the cloud deleted them on my home computer too and the photos were lost.

    I am presuming that we cannot share downloaded apps and music between accounts because of the copyright issue,
    Though I'm no copyright lawyer, as long as it's within a household, you can share content among users. Such sharing is, absent specific language preventing it not present in the iTunes Store terms of use, generally considered to be "personal use". So you can share apps and music amongst your users on your computer and with their devices. You just can't give any of that content to friends or relatives who don't live with you.
    What I am not clear on, it making sure that this appears in each itunes account - is it easy to find the file storage folders that match the itunes accounts and what would these be?
    The iTunes library and files are by default in a user's Home/Music folder. But you don't have to find the folder; in fact putting a file into the folder yourself won't add the file to iTunes. Just drag the file into the iTunes window. iTunes will copy it to the correct location.
    Regards.

  • What is the best way to manage my iPhoto, which is taking up too much space on my MacBook Pro?

    What is the best way to manage my iPhoto, which is taking up too much space on my MacBook Pro?
    Specifically, I'd like to keep some of my favorite pictures on the laptop while moving the rest to an external hard drive. Is there a way to tag just a few pictures inside an event/album as "favorite", while storing the rest in an EHD, but still keep them connected to the same event/album? I'd like to have just the favorite pictures on the laptop, but when I have the EHD connected,  be able to view all my pictures in the same place, and not have to browse through separate hard drives. Ideally, whether or not a picture is designated as "favorite" will determine where it resides.
    Is this at all possible?
    I have only 7 GB left on my HD and I'm desperately needing a solution!
    Thanks!

    You need two libraries to do this. One on the external with all your Photos. One on the internal with a subset - your favourites. You do it this way to make backing up easier - that is, back up the library with everything, so you're only backing up one.
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    Now you have two full versions of the Library.
    3. On the Internal library, trash the Events/albums/photos you don't want there
    Now you have a full copy of the Library on the External and a smaller subset on the Internal
    Some Notes:
    As a general rule: when deleting photos do them in batches of about 100 at a time. iPhoto can baulk at trashing large numbers at one go.
    You can choose which Library to open: Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Choose Library'
    You can keep the Library on the external updated with new imports using iPhoto Library Manager

  • Best way to manage a downloaded binary with pacman?

    Hi all,
    Supposing I downloaded a binary release of some project from a website, what would be the best way to keep track of all of the files using the package manager?  I'm new to PKGBUILDs and such, but my first thought was to write a PKGBUILD with the package information and only a package() step.  Is there a better way?  Am I way off?  Any help is appreciated!  Thanks!

    Excellent, thanks for the quick reply!
    Another quick/semi-related question, if I have a working copy of a project's source that I modify constantly, how would I manage/update the resulting binaries with the package manager?  Perhaps similar to above, but including a build() step, then building the project using makepkg?  Or I suppose I could just do exactly the same as above and run makepkg after it's built, but it made sense to me to bundle the building in with the PKGBUILD.

  • Best way to manage iMac and two iPads?

    Have a new iMac (Intel,OS X Lion) and two iPad 2.  The iMac is mine the and iPads are my kids. We all have our own apple IDs.  I ultimately want to do any downloading/purchasing on the iMac and then transfer the music/apps/movies to the iPads.
    What is the best way to manage them so I can sync the iMac to the iPads? 
    Can I download apps/music etc. on my iMac and then sync it to both of the iPads?
    Do I need to use the same Apple ID on all of them if I want to sync the iMac to the iPads?   I would prefer not to store credit card info on the kids iPads.
    Whats the most efficient way to handle this?  Sorry for so many questions.  Its a hazard of being a newbie.
    Thanks, Courtney

    The best way I can think of is for each iMac user create their own account for them. Then when they log in they can sync to their own AppleID account. It keeps things simple and separate. If you don't know how to create accounts please look over http://docs.info.apple.com/article.html?path=Mac/10.7/en/mtusr001.html

  • Best way to manage large library with AAC and MP3 versions of files

    I have a large library of music. I listen to music through iTunes and iPod/iPhones, but also other devices which only support MP3, and not AAC. I typically convert iTunes purchases to MP3, but I'm left with two copies of each song in the same folder. I'm looking for recommendations on the best way to manage what would essentially be a duplicated music library - a high quality version I use with my iTunes/ipods, and a lower quality MP3 version for the devices that only support that format.

    I have had a similar problem. I have all my music residing on a NAS where I access it from iTunes (for managing my iPods/iPhones) and a Tivo PVR (which is connected to my house stereo system.) The problem is that Tivo does not recognize AAC. So I've used iTunes to create mp3 versions of all my purchased AAC music. Because the NAS is set as my iTunes media folder location, iTunes puts the mp3 copies back into the existing folder structure (which it keeps organised) on the NAS. Tivo accesses the NAS directly, over the network. But iTunes also puts the additional copy into the iTunes library which leaves me with multiple copies of the same songs on iTunes AND my iPods. Having multiple copies on the NAS (mp3 for Tivo and AAC for iPod) is OK: I've got plenty of space on the NAS and the Tivo doesn't 'see' the AAC files.
    The solution I'm planning to implement is to delete the mp3 entries from the library as soon as I create them (leaving the files in the media folder.) But what I'm looking is for a way to automatically select the mp3 copies (for deletion) from the existing duplicates list. Any ideas?

  • Best way to manage small pieces of a 13 minute clip?

    A client has given me some AVI footage to cut in with some of my material.
    He's said 'at 13 min, 40 seconds' use 5 seconds. 'at 12 min, 10 seconds, use 8 seconds'.
    There will be some fades and I'll be adding text, etc. in Motion.
    What's the best way to manage this?
    I'd guess cutting this long clip info small pieces out using FCP and then import them into Motion?
    But, I was curious if there was a way to work completely in Motion?
    Also - if I drag from the edge of a clip in motion, thus changing the part of the clip displayed, I can't really tell what the timecode is (of the original position) even when I've turned on timecode rather than frames. Which would make doing any edits by absolute timecode rather hard.
    Is there a way to see the absolute timecode position in the clip after changing the parts of the clip that are displayed?

    Your original idea is right on. Cut up the clip in FCP. Don't try to work with a 13-minute clip in Motion - it won't like you. Motion will probably constantly crash try to process something that big, and it will just cause headaches.
    FCP will also display the absolute timecode.

Maybe you are looking for