How can I keep AppleScript repeat resetting Safari in the background?

I want to have an AppleScript which resets Safari every 10 seconds. Now I got a problem with repeating the script. After the script resets Safari it closes the app. I want to keep Safari open while the script is operating in the background.
That was my try:
=================
tell application "Safari" to launch
          tell application "Safari" to activate
          tell application "Safari" to open location "http://www.apple.com"
repeat
          tell application "Safari" to close every window
          try
                    tell application "Safari" to quit
          on error errmsg
                    display dialog "Safari App beenden gescheitert" with icon caution
          end try
          try
                    do shell script "rm -f ~/Library/Safari/history.plist"
          on error errmsg
                    display dialog "history.plist löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -f ~/Library/Safari/HistoryIndex.sk"
          on error errmsg
                    display dialog "HistoryIndex.sk löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -f ~/Library/Caches/com.apple.Safari/Cache.db"
          on error errmsg
                    display dialog "Cache.db löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -rf ~/Library/Caches/Metadata/Safari/History"
          on error errmsg
                    display dialog "History löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -f ~/Library/Cookies/Cookies.plist"
          on error errmsg
                    display dialog "Cookies.plist löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -f ~/Library/Safari/LastSession.plist"
          on error errmsg
                    display dialog "LastSession.plist löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -f ~/Library/Safari/TopSites.plist"
          on error errmsg
                    display dialog "TopSites.plist löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -rf ~/Library/Caches/com.Apple.Safari/*"
          on error errmsg
                    display dialog "Safari Cache löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -f ~/Library/Caches/Adobe/Flash Player/AssetCache"
          on error errmsg
                    display dialog "Flash Player AssetCache löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -rf ~/Library/Preferences/Macromedia/Flash*/macromedia.com/support/flashplayer/sys/ #*"
          on error errmsg
                    display dialog "Flash Player macromedia.com löschen gescheitert" with icon caution
          end try
          try
                    do shell script "rm -rf ~/Library/Preferences/Macromedia/Flash*/#SharedObjects/*"
          on error errmsg
                    display dialog "Flash Player #SharedObjects löschen gescheitert" with icon caution
          end try
  delay 10
end repeat
=================
PS: The dialogues are in German… But that shouldn't be a problem

You can use the applescript Script Menu to run scripts in Photoshop (or any application).
If you don't have it installed, run the AppleScript Utility.app (find it in the Applescript folder in your applications folder) and make sure the 'Show Script Menu in menu bar' is checked.
Edit: I thought you'd be able to use this with an action by inserting a menu item, but apparently it doesn't recognize the appescript menu.

Similar Messages

  • How can you keep full view of Safari on the screen when it opens up?

    Can't see full view of Safari when I start it up.

    System Preferences > General
    Uncheck the box next to    "Close windows windows when quitting an application".

  • I am doing two people's jobs and I need to use two separate log-ins on the same website. How can I keep both log-ins open at the same time. Everytime I switch tabs I have to log in again.

    I am doing two people's jobs and I need to use two separate log-ins on the same website. How can I keep both log-ins open at the same time. Everytime I switch tabs I have to log in again.

    Try one of these extensions for multiple cookie sessions.
    Multifox: <br />
    http://br.mozdev.org/multifox/ <br />
    Cookie Swap extension: <br />
    https://addons.mozilla.org/firefox/3255/ <br />
    Cookie Pie extension: <br />
    http://www.nektra.com/oss/firefox/extensions/cookiepie/

  • How can i open a pdf in safari without the screen turning black?

    How can I open a PDF in Safari without the screen turning black?

    Welcome to Apple Support Communities. We're all users here.
    Depending upon your version of OS X and your version of Safari, as detailed in the Adobe help document links below, Adobe pdf documents created with the latest releases may require an (updated free) Adobe plug-in for Safari, or (free) Adobe Reader in order to display properly.
    http://helpx.adobe.com/x-productkb/multi/safari-5-1-incompatible-reader.html
    http://www.adobe.com/support/downloads/product.jsp?platform=macintosh&product=10
    I encountered the problem recently when attempting to view documents from a financial institution.

  • How can I keep synchronized my macbook pro at the office and a traveling macbook air?

    How can I keep synchronized my macbook pro at the office and a traveling macbook air?

    Have you tried doing the sync via Time Machine?
    I thought it would be possible to backup the travelling machine and restore the machine at the office from the new backup.
    I read a warning from Apple that it is not advisable.
    I would be very interested in your opinion.

  • I just got an IPAD2 on Saturday.  With the Mac, I could always tell when programs were open/running by going to the menu bar.  How can I tell what programs are running in the background.  I am struggling with not being able to go to a menu bar at the top

    I just got an IPAD2 on Saturday.  With the Mac, I could always tell when programs were open/running by going to the menu bar.  How can I tell what programs are running in the background.  I am struggling with not being able to go to a menu bar at the top

    You can see which apps are open and/or recently used by double-clicking the home button to bring up the taskbar at the bottom of the screen (not all apps that appear there are active) - you can then close apps on it by pressing and holding one of them for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar. If you have an app 'open' on-screen then it won't appear on the taskbar, you will need to go back to the homescreen first, and it should then show when you next open the taskbar.
    If you haven't already got a copy then you can download the iPad manual from here : http://support.apple.com/manuals/#ipad

  • How can I know what apps are running in the background of Q10

    My battery is not lasting more than 12 hours even though I'm moderately using it. How can I tell which applications are running in the background?

    As of now, the BB10 does not allow any apps to run in the background unless they are baked in the OS or in the active frames. So if an app is not in a active frame, no app is running in the background. try maximizing your battery by switching to wif whenever you have a wifi network.
    Twitter: @ukmight
    1. Click on the " Like " button if you find anything helpful posted.
    2. If any of the replies in your post has resolved your problem, mark the reply(ies) as " Solution ", so that others can readily view the solution instead of creating another redundant post.

  • How can I tell if programs are running in the background.

    iPod touch version 4.2.1, how can I tell if programs are running in the background.  Battery is dead quickly and time/date reverts to Dec 31, 1969.  can see thin silver frame around screen like something is running in background.

    You really can't tell unless you hear music or similar. Many are always listening for notifications and other things.
    To preserve battery life see the following:
    Apple - Batteries - iPod
    I leave mine in airplane mode when sleeping.

  • How can I record with GarageBand 1.3 in the background using other app?

    How can I record with GarageBand 1.3 in the background using other app?
    I use iPad 2 with iOS 6 and GarageBand v1.3.
    I'd like to play an other app like Sunrizer synth while the GarageBand is recording in the background in a track.
    By now I can do it only using the build-in mic of iPad, but this is not the point.
    Can I record other apps in a GarageBand track?
    Thanks a lot for your time.

    I suspect you are probably correct about the reasoning, although there are already a myriad of ways to do that.
    Don't get me wrong - I never said I like this. But it is consistent with other Apple applications, that are similar restrictive; you cannot take a screenshot, when dvd-player is running for example.
    That are the moments, when I am glad that MacOS X is a unix system under the hood

  • HT201250 When Time Machine starts backingup, It popsup a small window that stays up the whole time it is backingup.  How can I make it do its job in the background without the popup?

    When Time Machine starts backingup, It popsup a small window that stays up the whole time it is backingup.  How can I make it do its job in the background without the popup?

    just let it do it for the first time.  actually you might want to option click the little symbol next to the time representing timemachine then click verify bacups
    Message was edited by: Carlo TD

  • Flash Builder 4.6 - How can I keep unit test classes out of the finished swc?

         I have a library of code I'm building and I'm working on unit testing but I have a major issue. When my finished swc compiles no matter what I do it includes the unit test classes as part of the intellisense if you load the swc via flash. The classes aren't really in the swc since if you just try and import them they'll come up undefined. They only appear to go into the intellisense for the swc. Does anyone know how can I keep this from happening in the finished source? Currently my folder setup is like this in flash builder.
    src\main - source documents for the library to get compiled
    src\mock - mock class area for unit testing
    src\test - unit test classes
         In the project Properties panel > the first tab of my Flex Library Build path I have selected only the src\main folder for the classes to inlude in the library. No other folder paths are selected.
    The "Flex Library Build Path" doesn't change my results with any setting.
    Thanks,

    Mel Riffe,
    Here's a Help topic about compiler options in Flash Builder: http://help.adobe.com/en_US/flashbuilder/using/WSe4e4b720da9dedb524b8220812e5611f28f-7fe7. html
    For information on using mxmlc, the application compiler, to compile SWF files from your ActionScript and MXML source files, you can see: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fcc.html
    Hope this helps,
    Mallika Yelandur
    Flash Builder Community Help & Learning
    Adobe Systems Incorporated

  • How can I find out what is running in the background and running my batterie down

    How can I find out what is running in the background

    Hi simpbarby,
    Welcome to the Support Communities!
    The links below will help you understand what apps are running on your iPhone.  You can quit the ones that you aren't using.
    iOS: Understanding multitasking
    http://support.apple.com/kb/ht4211
    This link will provides tips to conserving battery life:
    Apple - Batteries - iPhone
    http://www.apple.com/batteries/iphone.html
    Optimize Your Settings
    Depending on how they are set, a few features may decrease your iPhone battery life. The tips below apply to an iPhone running iOS 7.0 or later.
    Enable Wi-Fi: Having Wi-Fi enabled helps consume less power when doing activities that access data. Go to Settings > Wi-Fi and log in to a Wi-Fi network.
    Adjust brightness: Dim the screen or turn on Auto-Brightness to extend battery life. Turning on Auto-Brightness allows the screen to adjust based on lighting conditions.
    Fetch new data less frequently: The more frequently email or other data is fetched, the quicker your battery may drain. To fetch data manually: Go to Settings > Mail, Contacts, Calendars > Fetch New Data and tap Manually.
    Turn off push notifications: Apps with Push Notification alert you of new data, which may impact battery life. To disable, go to Settings > Notifications, choose the app you want to disable, and do the following:
    Change Alert Style to None.
    Turn Badge App Icon off.
    Turn Sounds off.
    Note: New data will be received when you open the app.
    Minimize use of location services: Apps that actively use location services, such as Maps, may reduce battery life. You can see which applications have recently used location services by going to Settings > Privacy > Location Services.
    Use Airplane Mode in low- or no-coverage areas: Your iPhone always tries to maintain a connection with the cellular network, which may use more power in low- or no-coverage areas. Turn on Airplane Mode to increase battery life in these situations.
    Viewing Usage StatisticsKnowing and understanding your iPhone usage can help you better manage your battery life. To view your iPhone usage statistics, go to Settings > General > Usage. Under “Time since last full charge”:
    Usage: Amount of time iPhone has been awake and in use since the last full charge. iPhone is awake when you’re on a call, using email, listening to music, browsing the web, or sending and receiving text messages, or during certain background tasks such as auto-checking email.
    Standby: Amount of time iPhone has been powered on since its last full charge, including the time the phone has been asleep.
    I hope this information helps ....
    Have a great day!
    - Judy

  • How can I keep iTunes on my Mac but the Movies on an external hard drive and still have them accessible to my Apple TV etc through Home Sharing?

    I have a 2TB external hard drive that I want to store my ripped movies on and free up space on my Mac. How can I do this?

    Is there a reason you don't want to keep your entire iTunes folder on the external.
    Everything will work just fine and it is simpler if everything in iTunes is in one location (the iTunes folder).
    Copy entire /Music/iTunes/ folder to external.
    Hold Option and launch iTunes.
    Select Choose library... and select the iTunes folder on the external.
    That is all you need to do.

  • How can I keep a network drive mounted all the time?

    I have a Mac Mini hooked to my TV which is running Boxee. All of the videos/music is pulled from a network drive.
    I have the drive set up to mount on Mac boot by putting it in my start up items. The problem I am running into is sometimes the drive will go offline or I may have to reboot it for one reason or another. When this happens the Mac Mini looses the mounted drive and I have to reboot the computer.
    What I need is some kind of application that sits in the background and constantly checks to see if the drive is mounted and if it is not it mounts it again for me like it does on start up.
    Any Ideas???

    Cron isn't used by OS X anymore, launchd handles scheduled tasks now, but you could still use cron if you wanted to schedule a task. This is a good place to start: http://hints.macworld.com/article.php?story=2001020700163714
    You can definitely set up a launchd daemon, but it might be pretty complicated if you've never done it, it also may be more than you want to invest in this particular issue. Read about it here:
    http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystem Startup/Articles/LaunchOnDemandDaemons.html
    I've also seen people recommend just setting an event to repeat in iCal. For the event, add an alarm, and as the alarm, tell it to run a script. Have the event repeat as often as you like, indefinitely. That, my friend, is a poor man's scheduled task solution.

  • How can I get my renders to work in the background?

    Hi,
    I installed After Effects pretty much without changing anything, so the settings are more or less default.
    I'm using a Macbook Pro with OS 10.6.8 and After Effects CS6
    I have enabled media and disk cache, max disc cache is at 100GB and I have an external drive (with 900GB spare) as the volume selected beneath that option. My internal SSD has not much spare on it. I previously had the internal SSD as the disc cache and still had this same problem.
    My project is 1920 x 1080 25fps - And I'm trying to render to Quicktime. I've tried rendering to stills and then outputting to Quicktime (so as to have less computational effort), then running them through but the same problem persists.
    If After Effects is the application in focus the project renders fine.
    If After Effects is not the application in focus - ie. I work with it rendering in the background, the 'FINISHED' sound plays and the render is cut short a short while after I started working in another program.
    The project render time is about an hour, so it's not really convenient.
    I've googled extensively and posted this here before and no solution.
    Please help.
    Toby
    ps. ADOBE: Don't mean to be rude, but is there some fix for this text entry box where the cursor randomly jumps to a previous line? - still broken guys!

    Hi Todd,
    Thanks, I've now installed the updates. Unfortunately the problem persists and furthermore, AME does not go the distance with rendering the full project, dropping the process after around the 5-8% mark (on first and second try).
    I can render the project successfully if AE is left unattended in the 'foreground'
    Please find attached screengrabs of my system profile and current AE settings (Disk and Cache settings were changed recently from having 100GB disk cache on external USB3 drive - still same behaviour).
    I notice there is no error log produced from AE as it seems to think the render is successfully completed. Please advise if I can produce a log to help troubleshoot this problem, as it seems AME does not provide a workaround.
    Thanks in advance.

Maybe you are looking for