Limiting time that an applescript application can remain open

I've written a short program to allow me to rapidly access and automatically logon to a number of servers that I frequently use. I got help from kel on setting up a user authentication requirement (in case I'm not at my computer) and have set up the window to close each time I select a server to mount (application remains open). I now am wondering if I could include a loop that will let the application remain open for 2-5 minutes (allows me to mount several servers with only one login for transfers etc.,) before automatically shutting down. Any help would be greatly appreciated.
intel mac mini   Mac OS X (10.4.8)  

Hi jar2005,
I'm not sure what you want to do, but you can usually use an idle handler for stuff dealing with time.
global target_date, delay_time
on run
set delay_time to 5 -- seconds
set target_date to (current date) + 5 * minutes
end run
on idle
set current_date to (current date)
if current_date > target_date then
set delay_time to 1
quit
else
-- do whatever
beep 1
end if
return delay_time
end idle
When you first run the script it initializes a delay time of 5 seconds and a target for quitting of 5 minutes from the time the scirpt is run. After it exits the run handler, it starts idling for 5 seconds on each run until 5 minutes has passed. Then it quits. You save idle handlers as stay open script application. You can use a repeat loop also, but the idle handler gives up the cpu during the delay.
I'm not sure if you wanted the script to wait or continue getting user input. If you mean that you want a dialog to quit, then you can use the 'giving up after' parameter.
display dialog "Enter something:" default answer "" giving up after 10
this dialog will wait for 10 seconds before closing. Note that you can find out if it gave up and have the script quit right there.
gl,

Similar Messages

  • How to control the maximum time that a dynamic sql can execute

    Hi,
    I want to restrict the maximum time that a dynamic sql can execute in a plsql block.
    If the execution is not completed, the execution should be terminated and a exception should be raised.
    Please let me know, if there is any provision for the same in Oracle 10g.
    I was reading about Oracle Resource Database Resource Manager, which talks about restricting the maximum time of execution for Oracle session for a user.
    However I am not sure, if this can be used to control the execution of dynamic sql in a plsql block.
    Please provide some pointers.
    Thank you,
    Warm Regards,
    Navin Srivastava

    navsriva wrote:
    We are building a messaging framework, which is used to send time sensitive messages to boundary system.I assume this means across application/database/server boundaries? Or is the message processing fully localised in the Oracle database instance?
    Every message has a time to live. if the processing of message does not occurs within the specified time, we have to rollback this processing and mark the message in error state.This is a problematic requirement.. Time is not consistent ito data processing on any platform (except real-time ones). For example, messageFoo1 has a TTL (time to live) of 1 sec. It needs to read a number of rows from a table. The mere factor of whether those rows are cached in the database buffer cache, or still residing on disk, will play a major role in execution time. Physical I/O is significantly slower that logical I/O.
    As a result, with the rows on disk, messageFoo1 exceeds the 1s TTL and fails. messageFoo2 is an identical message. It now finds most of the rows that were read by messageFoo1 in the buffer cache, enabling it to complete its processing under 1s.
    What is the business logic behind the fact that given this approach, messageFoo1 failed, and the identical messageFoo2 succeeded? The only difference was physical versus logical I/O. How can that influence the business validation/requirement model?
    If it does, then you need to look instead at a real-time operating system and server platform. Not Windows/Linux/Unix/etc. Not Oracle/SQL-Server/DB2/etc.
    TTL is also not time based in other s/w layers and processing. Take for example the traceroute and ping commands for the Internet Protocol (IP) stack. These commands send an ICMP (Internet Control Message Protocol) packet.
    This packet is constructed with a TTL value too. When TTL is exceeded, the packet expires and the sender receives a notification packet to that regard.
    However, this TTL is not time based, but "+hop+" based. Each server's IP stack that receives an ICMP packet as it is routed through the network, subtracts 1 from the TTL and the forwards the packet (with the new TTL value). When a server's IP stack sees that TTL is zero, it does not forward the packet (with a -1 TTL), but instead responds back to the sender with an ICMP packet informing the sender that the packet's TTL has expired.
    As you can see, this is a very sensible and practical implementation of TTL. Imagine now that this is time based.. and the complexities that will be involved for the IP stack s/w to deal with it in that format.
    Making exact response/execution times part of the actual functional business requirements need to be carefully considered.. as this is very unusual and typically only found in solutions implemented in real-time systems.

  • RMS stopped. Users told "only documents created in a signed application can be opened in a signed application"

    Hi
    I hope you can help and that this is the right forum.
    We have a RMS 1.0 sp1 server which has stopped working.
    Users get "only documents  created in a signed application can be opened in a signed application" when trying to protect a document in word or Outlook, and are unable to open previously protected documents.
    C:\Users\username\Local Settings\Application Data\Microsoft\DRM - only has the one file in it which is DRM-Machine. the .eul .CLC and .Gic files are missing from this folder.
    The server running the rms has an event id 82. " the callers machine certificate has a certificate chain that is not valid"
    I ran an irmcheck on the local machine which showed " No user Certificate"
    I can connect to the rms server urls , both licensing and certificate with no errors and IE shows the zone to be local intranet.
    Can anyone see what my problem might be and suggest why the workstations are not getting their certs and allowed protection? What else should I be checking?
    Best Regards
    Steen

    Hi
    Here is the answer which resolved my situation, I hope it helps yours.
    Guybrush-Threepwood I've marked your post as helpful as we had installed SP2 but it was not installed correctly and installing correctly was part of the solution.
    PROBLEM:
    Client began seeing the error:
    “Only documents created in a signed application can be opened in a signed application”
    On the server we were getting events:
    “The callers machine certificate has a certificate chain that is not valid”
    CAUSE:  
    Servers running RMS before SP2 can no longer get a valid Server Licensor Certificate.
    RESOLUTION:
    1. Install RMS v1 SP2 from:
    http://www.microsoft.com/en-us/download/details.aspx?id=14329
    2. Locate and then click the following key in the registry.
    For the enrollment URL on x86 versions of Windows Server 2003:
    HKEY_LOCAL_MACHINE\Software\Microsoft\DRMS\1.0\
    For the enrollment URL on x64 versions of Windows Server 2003:
    HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\DRMS\1.0\
    3. On the Edit menu, point to New, and then click String value.
    4. Type EnrollmentURL, and then press Enter.
     5. On the Edit menu, click Modify.
     6. Type
    https://activation.drm.microsoft.com/enrollment/enrollservice.asmx, and then click OK.
     7. On the Edit menu, point to New, and then click String value.
    8. Type CloudGicURL, and then press Enter.
     9. On the Edit menu, click Modify.
     10. Type
    https://certification.drm.microsoft.com/certification/certification.asmx, and then click OK.
    11. Go into the RMS Web interface and renew the SLC
    HTH

  • Application can't open -10810

    Hi,
    I've downloaded a WOW launcher on my mac .. at first inside the launcher.app (in its package's contents) wasnt an exec file so i did my research found a solution to that problem i used "chmod +x" it worked it changed to a exec file but after that when i click on launcher.app i get this error "application can't open -10810" , however if i right click on it and choose show package content and run the exec file there , a terminal window will open and eventually the launcher works.
    how can i fix this error , thanks !

    Hi,
    have a look here http://reviews.cnet.com/8301-13727_7-10365239-263.html for possible solutions.
    Hope it helps
    Stefan

  • Today I think firefox automatically installed a new version and after that it said my adobe flash was old so I had to update that. Now I can't open links in a new window.

    Today I think firefox automatically installed a new version and after that it said my adobe flash was old so I had to update that. Now I can't open links in a new window.

    Firefox doesn't install new versions of plugins, but Flash may update itself automatically.<br />
    You are still one version behind on Flash, current is Flash 10.1 r85<br />
    If the Flash player didn't update properly then you need to download the full version and run the installer as Administrator (right-click: Run as ...)
    Flash Global Notifications Settings Panel:<br />
    *http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager05.html
    You are more versions behind on Java updates with having Java 6 U11, current is 6 U22.
    *Java Plug-in 1.6.0_11 for Netscape Navigator (DLL Helper)
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)

  • Time Machine restore and now can't open application

    Sorry if this is long but I'm not sure how much is relevant to the current problem. It all started when I received an email with a small excel file. The email would not finish downloading and the color wheel of death was spinning on mail and Safari. Eventually Safari came back to life but mail never did. I could not force quit mail so holding down the power button was the next step. Upon re-booting the screens were blue alternating between three shades. Trying over and over gave the same results. Booted into a different hard drive, opened Windows XP on Boot Camp and brought the email in with no problem. Checked it with McAffee and found no problems.
    Went back to OX on a hard drive that was fine, used Disk Utilities and attempted to repair disk with no luck. Tried to re-install both 10.5 & 10.6 and neither would install. Erased the hard drive and tried again with no luck. Got a replacement hard drive 1T from Seagate, put in 10.5 DVD and in utilities chose restore from time machine. Went to a restore point a couple of hours before the problem started just to be safe. When restore was complete, about a hour for 350G, I rebooted as directed. The gray screen with the apple logo appeared then darkened and a message appeared directing to shut down using the power button. Several tries produced the same results. I then went to a different hard drive and opened applications for the problem hard drive. It appears the restore brought back everything but almost all application icons are grayed out with a slash across them, not third party stuff either but iTunes, Safari, System Preferences, Mail etc. When clicking on them I get the pop up "You can't open the application ____ because it is not supported on this type of Mac"
    Many of the steps described have been tried over and over again with hopes of a different result (Yes, I know that is the definition of insanity). I have even repeatedly switched the hard drives to different bays wondering if it could be a hardware problem. So far I have over 20 hours invested in this problem so any help would be greatly appreciated.

    PCRinAZ wrote:
    The gray screen with the apple logo appeared then darkened and a message appeared directing to shut down using the power button.
    Is that the one in several languages? If so, that's a *kernel panic.* They're usually hardware, but not always. Disconnect everything, except keyboard and mouse. Reconnect one at a time to see if you can find the culprit.
    If that's no help, disconnect everything again and run the Apple Hardware Test, from the separate disc that came with your Mac. Instructions should be printed on it (in very tiny type).
    If it passes that, you might want to download and run the Rember app, a free and much more extensive memory test: http://www.kelleycomputing.net/rember/
    more kernel panic info:
    http://support.apple.com/kb/HT1392
    http://www.index-site.com/kernelpanic.html
    http://www.thexlab.com/faqs/kernelpanics.html
    Several tries produced the same results. I then went to a different hard drive and opened applications for the problem hard drive.
    You lost me there. What is the "different hard drive"? A clone? Of the same Mac?
    Which is the "problem hard drive," the replaced internal?
    It appears the restore brought back everything but almost all application icons are grayed out with a slash across them, not third party stuff either but iTunes, Safari, System Preferences, Mail etc. When clicking on them I get the pop up "You can't open the application ____ because it is not supported on this type of Mac"
    This almost sounds like you got PPC stuff restored onto an Intel, or vice-versa.

  • TS4424 I have done these steps 3 times now and I still can't open mail.

    Mail is in the Applications folder, not in any subfolder; it's never been anywhere else. There is only Mail application on my computer, and it still won't open! Help!
    I have downloaded the MacOSXUpdCombo10.6.8.dmg and SecUpd2012-004.dmg updates and restarted my computer.  I've done this process 3 times.  Before the first time, I deleted the non-working Mail from my computer.  After each set of updates, I checked the mail application and it still did not work. 
    All I did was update when it prompted, just like normal, just like every update - and now my Mail application seems lost forever.  Why would this happen on a non-related update?!
    I have searched a few threads, and many say the same thing about the 2 updates above.  Does anyone else have any other solutions?  Can I re-download the Mail application from somewhere without having to pay for it?

    Same thing happened to me-got same message box. I am totally not computer savy! I tried lots of fixes that I read on here but nothing helped me except one (link below).I had problem about 6 months ago after update and restored mail in my time machine. So I had more than one "mail" listed in my application folder. I wasnt sure which one I could delete or if I could back then so I just left it-so there were several MAILs with different names. Apparently that's where the problem began with the new security update. I read on link below that you need to get rid of all other mails except the original so it be the original MAIL and should just say "MAIL" not "MAIL(original)" like mine did. I went into my Time Machine all the way back to when I first got computer -searched under applications for mail- found it (the one with little stamp symbol icon) highlighted it and hit restore. Threw all the other "present" versions in trash.(Not sure if they were left on desktop if it would work??-just had to be careful not to empty trash just in case this didnt  work because I was really not sure if it was gonna work and I would lose previous MAIL applications and all my past emails) I threw all the weird little new pencil icon application versions of MAIL  away too(the ones I couldn't open). Searched in my present application so only one original MAIL that I pulled from TM was on there. Before that-in all my troubleshooting- I had downloaded the latest security update and the latest Java for mac update (my OS is snow leopard so it was the first one and security update was on the next page-but make sure you get regular one not server one-it's confusing -there are two for snow leopard) http://support.apple.com/downloads/ I dont think it matters that you have to keep downloading the upodates because I did several times. I think it just matters when you run it each time you switch things around and remember to restart your computer. And not ouch anything before you restart. So I threw out all the old MAILS except for one I pulled of TM. Then I reran the security update that I downlaoded and restarted the computer. It was the first time that-when I restarted-my mail icon didnt turn into a litle pencil and paper icon. It remained a stamp. So I clicked on it (the one in applications folder-I deleted the one on the bbar at the bottom previuosly) and IT WORKED. Others have said their MAIL application was not in the applications folder and missing somewhere else on their computer -that's all they needed to do to fix it-move it to the applications folder. Mine was more complicated. Hope you get it working. I've spent the last 4 hrs working on a fix for mine. Ugh. Good luck!
    LC
    https://discussions.apple.com/thread/4311280?start=90&tstart=0

  • HT201250 Backups in time machine visible but I can not open them.

    My time machine works theoretically. It backs up and I can see the data there. But it is showen in a light blue/grey colour and I can not open them.

    In the Finder, right-click or control-click the folder icon and select Show View Options from the contextual menu. In the dialog that opens, select None from the Arrange by menu. Close the dialog and try again.

  • I am using Numbers on my IPad2 and I cant find any security option to protect spreadsheets.  It seems that any spreadsheet you have remains open and therefore available for anyone to see - any ideas?

    I am using Numbers on my IPad 2 and I cant find any security option to protect spreadsheets.  It seems any spreadsheet you have remains open and therefore anyone can read the content.  I am assuming there must be some way of giving some protection?
    Help??

    There is no password protect feature for Numbers on iPad.

  • Have a message window that says damaged project can't open

    Have a message window that says can't open project because project damaged can this be resolved and reopen to continue working on project?

    Mumphie
    What version of Premiere Elements are you using and on what computer operating system is it running?
    You have not given us enough information with which to help you. For starters, besides version and computer operating system, please supply
    1. Project Preset
    2. Properties of Source Media
    3. Details of the projects save/close.
    Also please review the Adobe document on troubleshooting damaged projects.
    Troubleshoot a damaged project file | Adobe Premiere Elements
    After that we can customize the troubleshooting strategy to your particular circumstances.
    Any questions or need clarification, please ask.
    Looking forward to your follow up.
    Thanks.
    ATR

  • What the answer for this  error on a Macintosh system, the application can not open because "NameRegistryLib" could not be found

    what the answer for this error, the application could not open because the "NameRegistryLib" could not be found

    http://www.everymac.com/mac-answers/mac-os-9-classic-support-faq/run-macos-9-on- intel-macs.html
    http://www.macwindows.com/Emulator-for-Mac-OS-9-in-OS-X-updated-for-Mountain-Lio n.html
    http://hints.macworld.com/article.php?story=20060509180914879
    How to run Classic (pre OS X) apps on Intel Macs  

  • Hi first time mac user here, how can i open up more than one email account (hotmail) without merging them? I have merged 2 already Th.

    Hi, how can i open up more email accounts (hotmail)? I have accidentally merged 2 - not sure how but urgently need to access others and cannot run this risk!  thx

    Hotmail is not part of the Mac OS - I'd check their website (Hotmail or Microsoft) to see how to do it.

  • FILE-MENU refuses to open 10% of the time. Of that about 1/3 can be opened with Alt-F. Not website related.

    Sorry for the ramble:
    Clean installed FFox 14.0.1 - 2 days ago. Installed all plug-ins, extensions etc just as I had in FFox 3.6.28. All good so far.
    Played around a LOT til got buttons, tabs etc looking-going lovely.
    Since then 90% of time "File Menu" (u know, next to Edit :-) works fine. Other 10% it REFUSES to open. I read LOTS and besides side-tracks of other people's problems, I read about using Alt-F --- so I tried it, but only about 1/3 of the time does it come to life, the rest it refuses.
    It happens: Regardless of how many tabs, dozens of websites, etc... it just seems to lose the plot.
    It's now doing it about 4 times per 3 hour stint!
    Minimizing Ffox DOES NOT fix it.
    Closing Ffox all-together & restarting (( DOES FIX IT )) but it's something that shouldn't happen at all.
    If it turns out it's by cross-breeding (plugins) with too many dogs, I apologise in advance.
    Other than that --- WOW WHAT A BLOODY GREAT piece of software! Truly was worth the stress of getting into another version of the program.
    3 positive pieces to note is that:
    > Symantec 'Norton Safe Surf' is now back again (n/a in 3.6.10-3.6.28)
    > Well done on great s'ware and WHAT? for free Wow!
    > Brilliant decision to allow others to write & publish their add-ons for this prog. and for free!
    Thanks

    It is possible that one of your extensions is causing the problem. I would try to disable them one by one,and then run tests between each one, until you find the culprit.

  • Problem Application - can't open Applications folder in finder

    Dear All,
    I went to upgrade an application (Transmission) today, but during the upgrade, my macbook requested to be restarted. I did this, and now whenever that application is encountered in finder, it crashes finder. This means I cannot open the folder in finder, or from my dock. If I search for it using spotlight, it also crashes.
    I have tried deleting it through terminal, but when I navigate to the applications folder, and type "ls -l", no contents are listed, though I can still load other applications through spotlight.
    Does anyone have any idea what I might be able to do to delete this problem application? I was hoping to just do a system restore using my time-machine backups, but I don't have an install CD, and apparently you can't do that without one of those.
    Thank you in advance for any advice!
    Tom (UK)

    tjw62 wrote:
    I went to upgrade an application (Transmission) today, but during the upgrade, my macbook requested to be restarted. I did this, and now whenever that application is encountered in finder, it crashes finder. This means I cannot open the folder in finder, or from my dock. If I search for it using spotlight, it also crashes.
    Welcome to Apple's discussion groups.
    I'd launch the Console utility and look under ~/Library/Logs and /Library/Logs for a CrashReporter item. If you see a Finder crash log in either of those locations, post the contents here and someone may be able to help you decipher what's wrong.
    I'd also use Disk Utility to do a "verify disk" operation on your boot drive to see if that reveals anything.
    Does anyone have any idea what I might be able to do to delete this problem application? I was hoping to just do a system restore using my time-machine backups, but I don't have an install CD, and apparently you can't do that without one of those.
    If all else fails it's probably possible to use commands in the Terminal application to delete the problematic application, but first I'd try the things I suggest above.

  • Application can not open

    I just bought a ipod touch 8G.At first I use it download application.It works.But when I sync itunes.All application dose not work any more.When you open it then back to desk.I call apple hotline.They told me authorize computer and reset your ipod touch...I did it.But still dose not work.HELP

    My iPod touch is less than 24 hours old.
    I loaded the Facebook app and it worked without any problems. Next, I installed Bejeweled 2, Pandora, & Convert ~ the unit calculator. None of them worked. They would open for a half a second then close. Eventually, the Facebook app stopped working too.
    I started combing the Internet for answers and everybody was saying the same things. I tried the following:
    1) Deleting and resyncing my apps through iTunes -- didn't work
    2) Deleting and reinstalling (from the web through my iPod touch) -- didn't work
    3) Deauthorizing and reauthorizing my computer -- didn't work
    4) Deauthorizing and reauthorizing my computer and deleting then resyncing apps -- didn't work
    5) Deauthorizing and reauthorizing my computer and deleting and reinstalling my apps -- didn't work
    6) Deleting and reinstalling apps one at a time in case one app was messing all of them up -- didn't work
    ....At this point, I found the suggestion here about resetting to factory defaults and tried....
    7) "Erase All Content and Settings" via Settings/General/Reset -- didn't work
    But, it was through this last option that I finally got things working again. There are a few different ways to proceed with option 7. You can do a complete reset, then iTunes will ask if you want to set up your iPod touch as a new device or use the setup from the first time. My results were:
    8) Did step 7 then set up as old and resynced apps -- didn't work
    ...I unchecked all apps in iTunes, then...
    9) Did step 7 then set up as old and resynced but with no apps selected, then installed one app -- WORKED! Installed more apps -- Didn't work (and now the first app wouldn't work either)
    8) Did step 7 then set up as NEW device and resynced from old setup -- MIGHT HAVED WORKED... read on.
    Near the end of this process, I tried a few different setup options and I'm not clear on which one worked. I had begun suspecting that only apps that were tested on an iPod touch are the only ones that were working. As I explored a few variations on resetting and resyncing, it finally worked but I'm not sure which combo actually worked. Although, I know for sure that resetting to factory defaults and setting up as a new device was part of the process. Also, I think I started adding the apps again one at a time, testing and adding each one until after the first 3 worked, then I think I resynced all of them (maybe 6) and they all worked.
    Since then, I've installed several others and I'm not having any trouble at all.
    I gotta say, I love my iPods. Apple is pretty creative and they're innovators. But they are NOT good at solving problems when a situation comes up where so many people are having the same problem and looking for answers and you never see any posts by Apple with the solution. When someone actually calls Apple for support, I've never read about a successful solution being given by support.
    I hope this helps you solve your problem. If it does, please respond here so other people know. Also, copy and paste a description of what worked and share it elsewhere.
    Good Luck!
    Scott

Maybe you are looking for

  • Understanding Fan, Fan Control, and Heating Intel iMac

    Greetings all, I'm a recent convert from the world of Windows to Mac and I've enjoyed it more than you can imagine. I'm a network admin at a major airport and have come to hate working on Windows during the day to working on Windows at home. Although

  • How do you change the picture when logging in

    I want to change the picture / Icon when I log in.  How do I do that?

  • Index seen in RoboHelp does not match CHM

    I have a project which has conditional text and topics to enable me to create different CHM Help files for four variations of an application. I haven't noticed any problems with the indexes in previous versions of the Help files that I've generated b

  • Solid Yellow Light requiring reset

    I have an AirPort Extreme base station with two iMacs as my basic wireless home network. I have a TiVo Series 2 unit also on the network. My DSL modem is attached to the AirPort Extreme base station and I have a rock solid connection to the Internet

  • Content Type field

    Is it possible to remove the hyphen between the Type and the Description in the Content Type field? Or maybe someone can recommend a good way to utilize it in it's current state. In most cases we currently have something like 'Flowcharts' without a d