AppleScript or Automater to Set Time Zone (or just the time)

Hi,
I am trying to have a script that will change the timezone to UK - (ie reduce my macbook by one hour from European time) before I run an application.
I use a MythTV backend on my network that is in UK time, and I am in Europe. However, the mythfront end I have on my mac needs to be in same timezone for it to work with the backend.
However, instead of having to go to the System Prefs before I want to run the myth front end, I'll like to build a Automater workflow (app) that changes time to UK time, runs the mythfront end (and changes back once I close myth front end).
My problem is I can't get any workflow to work to change the timezone. I found a workflow on the net for Automater, but this doesn't work. The auomater app was called 'Set Time Zone 1.0 - by NyghtHawk productions' but only returns this error about not being able to find this file:
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/syst emsetup-panther.
(which I guess is obvious as I'm using Snow leopard and not panther)
Does anyone know of a working way to script setting the time in Mac Os X ?
Thanks in advance
Alex

I have solved the Applescripting of System Preferences to change the Time Zone.
My problem is that my time zone (Melbourne - Australia) causes my 3rd gen iPod nano to lose its time zone and time settings when it is _plugged in_ to my mac (Note: Not when it is synchronised).
I have a pair of Applescripts: the first sets the time zone to Noumea, run before the iPod is plugged in and the second resets the time zone to Melbourne after the iPod is physically disconnected.
timezone=Noumea
This script is run BEFORE plugging in the iPod.
This ensures the iPod time zone is not NUKED.
The corresponding script to reset time zone is
run when iPod is physically disconnected
tell application "System Preferences" to activate
tell application "System Events"
tell process "System Preferences"
(* get Date & Time preference pane *)
tell menu bar item "View" of menu bar 1
delay 0.5
click menu item "Date & Time" of menu 1
end tell
(* get Time Zone subpane *)
tell tab group 1 of window "Date & Time"
click radio button "Time Zone"
tell group 1
set value of combo box 1 to "Nouméa - New Caledonia"
We need to focus the combo box before "hitting" return
PROBLEM: we dont know if it is already focused
a) if is already focused the first 'return' key sets the time zone
b) if was not focused the first 'return' key does nothing
the 'tab' key will then focus it
and then the second 'return' key sets the time zone
keystroke return & tab & return -- make it stick
delay 0.5
end tell
end tell
end tell
end tell
timezone=Melbourne
This script is run AFTER physically disconnecting the iPod.
This ensures the iPod time zone is not NUKED.
The corresponding script to set up the time zone to Noumea
is run BEFORE iPod is physically plugged in
tell application "System Preferences" to activate
tell application "System Events"
tell process "System Preferences"
(* get Date & Time preference pane *)
tell menu bar item "View" of menu bar 1
delay 0.5
click menu item "Date & Time" of menu 1
end tell
(* get Time Zone subpane *)
tell tab group 1 of window "Date & Time"
click radio button "Time Zone"
tell group 1
set value of combo box 1 to "Melbourne - Australia"
We need to focus the combo box before "hitting" return
PROBLEM: we dont know if it is already focused
a) if is already focused the first 'return' key sets the time zone
b) if was not focused the first 'return' key does nothing
the 'tab' key will then focus it
and then the second 'return' key sets the time zone
keystroke return & tab & return -- make it stick
delay 0.5
end tell
end tell
end tell
end tell

Similar Messages

  • Setting background color to just the root node in a tree

    How can I set a background color to just the root node in a tree? I got the node in the followig way in the renderer method.
    IconNodeClass parentIconNode = (IconNodeClass)((IconNodeClass)value).getRoot();
    Then how can I set the background for just the root node? Thanks.

    You need to write ur own treeCellRenderer for that to be done

  • Set Time Zone automatically doesn't work?

    Just returned from a trip to Greece (back home now in Phoenix). Noticed that even connected to wifi in different locations, when "set time zone automatically" was clicked on in general settings, time displayed on iPad seemed stuck in EST. (I made a stop in Philly on way to trip, not sure if that has to do with anything.)
    If i click "set time zone automatically" to off, for some reason my iPad defaults to Washington DC, even though in all my calendar/email settings i have Phoenix set as local time zone. I can change Washington DC to Phoenix and correct time displays on iPad. Just wondering why i can't set it automatically to display correct local time?
    Thanks for any suggestions....

    Ok thanks. Yeah, I ended up using the World Clocks.
    Where it gets interested is, iCal. If you're in a foreign country that's, say, 4 hours ahead, and you add iCal entries to your Calendar while you're out there, should those entries reflect the local time or the home time?
    Also, if you're set the Alarm to wake you up at 8:00am, and you're away on holiday, surely it will go off at home time, not local time, thus going off at the WRONG time.

  • Set Time Automatically without changing time zones?

    Is there a way to choose Set Time Automatically (in Settings/General/Date & Time) and not have Calendar change the times of my appointments when I change time zones?

    Here's what solved my problem: NOT checking Set Time Automatically, and NOT checking Set Time Zone Automatically.  Then manually selecting the proper time zone and city.
    Doing that displays the correct local time, without changing iCal times.

  • Setting time automatically doesn't work?

    One of the less obvious new features in iOS 4.2 is that there is now an option in your Settings app to set the time automatically.
    The only problem with that option is that it doesn't work - at least not for me. Actually, what happens when I enable that option is that it turns back my clock by 18 minutes. I've tried syncing, waiting, switching the option on or off while connected or not connected to iTunes, and a few other things. Nothing helped.
    Interestingly enough, this new option is not mentioned in the updated iPad User Guide, so I'm not sure how it's supposed to work.
    Any ideas? My timezone is set correctly.

    Yeah, something seems to be broken... I have a WiFi - 3G iPad but I've never turned on the 3G so I'm running (and have always run) WiFi only... My iPad normally lives in California (Cupertino is the default time zone for California) but I am presently in Kansas City visiting family. I also just downloaded and installed the new 4.2 OS yesterday so maybe that has something to do with the issue???
    Anyway, if I turn "Set time automatically" to OFF, set the time zone to either Dallas or Chicago (two choices for the Central time zone where I am now and set the time manually, I can then change the time zone to Denver (all as an experiment) and the time rolls back one hour (so far so good)... I then change the time zone to Cupertino (Ca) and it rolls back another hours (again, good)... Then I reset it to say Chicago (Central) and it moves forward two hours (again, check)... Then, for grins, with it sitting right there and the correct Central time and with Chicago chosen as the current time zone, I then "Set time automatically" back to ON and the time now rolls FORWARD TWO MORE HOURS where it should not go... The bottom line is with "Set time automatically" turned ON I get the wrong time by two hours... Now granted, there is a two hour time zone difference between where I originally set up this machine and where I am now and maybe that has something to do with it??? Or something is broken in the OS...
    Anyone have any thoughts or guidance???
    thanks... bob...

  • Set time automatically suddenly 5h 56min slow

    This is bizarre and AT&T was not able to help.
    Two days when traveling by car from Minneapolis to Fargo (same time zones) my iPhone 4 phone suddenly began to display a time that was 5 hours and 54 minutes in the past. What is strange is that one of my passenger's Blackberry also on AT&T displayed the same incorrect time. It gets better, she also has an iPhone 4 and it showed the correct time. Our third passenger with an AT&T blackberry also showed the correct time.
    So 2 iPhone 4. One with correct and one with incorrect time
    2 AT&T blackberries. One with correct and one incorrect time.
    Both phones with incorrect time have the same incorrect time.
    Turning phones on and off did nothing. Turning off "Set Automatically" in Date and Time on the phone, setting the time correctly and then later reenabling the automatic setting of time and the phone automatically goes back to being 5h56m in the past.
    I am now in Bismarck ND and the problem remains.
    I will be returning to Minneapolis in 2 days and will see what happens when I do
    Any suggestions as to what is going on and what I can do?
    Paul

    Hi
    It happens to me too, in Europe. Same problem with about 5 hours and 2 days back in the past! No idea how to solve this exept to not set the time automatically. So it is not really solved! Synching and rebooting didn't help here.
    I noticed on twitter that we are not alone...
    I hope the upcoming update will help.

  • Set Time & Date Automatically

    Hi folks, I ventured into the Time/date settings and have my time zone set to Eastern USA, and checked the set time/date automatically setting. Then I locked that window via the paclock in the lower left.
    How often does Snow Leopard ping those servers? What would happen if for whatever reason the time server was not reachable?
    What if the LAN I'm on has its own time service?

    I found this thread while investigating a solution for the same problem on my one-month-old unibody MBP running 10.5.6. The clock on my MBP and my old G4 iMac have never been in sync because the iMac (forever stuck on Tiger) can set the time automatically using a time server and the MBP cannot.
    I keep all of the System Preferences which have lock/unlock capability locked. Once I unlocked the Date & Time preferences and enabled the "automatic" option, re-locking or leaving Date & Time unlocked had no effect. If I quit System Preferences, the "Set date & time automatically" option in the Date & Time pane would be unchecked the next time I opened System Preferences and went into the Date & Time pane.
    I tried the new user creation--no admin privileges--and that did not have any effect, so I deleted the non-admin user. On a whim, I created another admin user (my account is an admin). Before logging in as the new admin user, I made sure the "automatic" option was enabled and the Date & Time pane was locked. I think I quit System Preferences at this point, but I am not absolutely certain. I used fast user switching to login as the new admin user, went into the Date & Time preferences pane, and the "automatic" option was checked. I switched between the accounts a couple of times, going in and out of System Preferences in each account and the "automatic" option stayed enabled. I logged out of both accounts and the "automatic" option survived when I logged back into my usual account. The next thing I did was delete the new admin user and restart the computer. When I logged in normally, the "automatic" option was still set.
    I have no idea why creating a new admin account would solve the problem and I would be really interested to know if it works for anyone else....

  • Missing Menu Item: Settings- General- Date & Time- Automatically Set Time Z

    I'm running F/W 1.1.4 on my iPhone (German TMobile contract). The Date&Time settings menu is lacking the menu item for the automatic adjustment of the Timezone. The Apple Genius Bar recommended to reset the phone, which I did with no success. Same my second iPhone with TMobile contract. All other iPhones with identical F/W build numbers which I looked at at the (US) Apple stores showed that menu item.
    Does anybody see the same problem? Any idea to resolve this?
    Many thanks, Hans-Uwe

    Page 151 iPhone5 user guide....does this help?
    Set whether iPhone updates the date and time automatically
    Go to Settings > General > Date & Time, then turn Set Automatically on or off.
    If iPhone is set to update the time automatically, it gets the correct time over the cellular network and updates it for the time zone you’re in.
    Some carriers don’t support network time in all areas. If you’re traveling, iPhone may not be able to automatically set the local time.
    Set the date and time manually
    Go to Settings > General > Date & Time, then turn Set Automatically off. Tap Time Zone to set your time zone. Tap the Date & Time button, then tap Set Date & Time and enter the date and time.

  • Why is the location services arrow constantly on for setting time zone on iOS 5.1?

    I have updated to iOS 5.1 OTA (Over The Air, not by connecting to iTunes and updating) on my iPhone 4S and the purple location services arrow is constantly on in the status bar when setting time zone and automatic update of date and time are turned on simultaneously. I had this problem prior to the update, but I understand that not everyone has this issue as my friend has these two settings on and doesn't have the problem. I have tried restoring and all that (obviously), but not restoring and setting up as new.
    Somebody please help because it's an obvious fault in the system if nothing else. I have heard somebody else complain about this and the had a 32 GB 4S the same as me. I don't really see why memory should matter but my friend who doesn't have the problem has a 16GB 4S.
    Also, I am not in an area that is between time zones when this is happening.

    If it is turned on I can't be sure if anything else is using my location (at a glance) since the arrow is constantly showing. I am aware that this function will use battery power, maybe constantly, but the arrow shouldn't be constantly showing. If it should, then why doesn't my friends iPhone show it? Either way there is a problem here.

  • How may I automatically stop and start Mail services at a set time please

    Hi folks. I was wondering if anyone could tell me how to automatically stop and start Mail services (or any other services) at a set time please in Leopard Server? Is there a script someone has created which might help?
    Cheers, David ( a realy newbie when it comes to administering OS X server)

    launchd works through a series of XML documents that define tasks to run, either at launch, on a time schedule, in response to network events, etc.
    So you'll need to create two .plists - one to start the mail server and one to stop it. They should be saved in /Library/LaunchDaemons. I'd suggest something like:
    /Library/LaunchDaemons/local.postfix.stop.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple
    .com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>local.postfix.stop</string>
      <key>ProgramArguments</key>
      <array>
        <string>/usr/sbin/serveradmin</string>
        <string>stop</string>
        <string>mail</string>
      </array>
      <key>StartCalendarInterval</key>
      <dict>
        <key>Hour</key>
        <integer>1</integer>
        <key>Minute</key>
        <integer>00</integer>
      </dict>
    </dict>
    </plist>
    and /Library/LaunchDaemons/local.postfix.start.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple
    .com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>local.postfix.start</string>
      <key>ProgramArguments</key>
      <array>
        <string>/usr/sbin/serveradmin</string>
        <string>start</string>
        <string>mail</string>
      </array>
      <key>StartCalendarInterval</key>
      <dict>
        <key>Hour</key>
        <integer>4</integer>
        <key>Minute</key>
        <integer>00</integer>
      </dict>
    </dict>
    </plist>
    You'll need to either use launchctl load /Library/LaunchDaemons/local.postfix.stop (or start) to load the tasks, or reboot your server.
    I'm curious, though, as to why you want to do this. Mail is typically one of the services that people want to run 24/7 so they don't miss out on any emails (even though SMTP can tolerate this). Why do you want to shut yours down?

  • Will my phone automatically go one hour ahead tonight for the time change? Also, if I set my alarm will it go off at the time it's supposed to, or an hour later?

    I live in ny and was wondering if tonight with the time change, will my iPhone automatically change the time? Also, if my alarm is set to go off in the morning, will it go off an hour later, or at the time that its supposed to?

    On your iPhone, go to Settings > General > Date & Time.
    If you have Set Automatically selected, the date and time for your iPhone is set automtically based on the tower your iPhone is connected to with your cell phone carrier.
    The date and time will be changed automatically on your iPhone based on your carrier changing the date and time at the tower your iPhone is connected with.
    If the date and time is changed automatically on your iPhone, the alarm wiil go off at the selected time for the alarm. If you need to ensure you don't miss waking up at the designated time, I would use a backup alarm that is not based on the date and time being changed by your cell phone carrier.

  • KDE: Setting time and date automatically

    I've never been able to set the time and date automatically in KDE time settings. When I check the "Set time and date automatically" and authenticate myself, I always get the error message "Unable to contact time server: .". I'm wondering whether it's an upstream bug or I'm missing some required package? Does it work for you?

    matt101 wrote:I don't get it i have installed ntpd using pacman -S ntp . And then after it installed I restarted my computer and i still can't change the time to London and am still getting the "Unable to contact time server" error. Am i misinterpreting this or what? Could somone please explain to me in simple terms how to make the KDE clock show London time?
    Have you set ntp correctly?
    Also go to http://www.pool.ntp.org/en/use.html you'll have all the answers there.
    in short try this:
    ntpq -p
    If nothing happens you did something wrong, if it does, then it already works just remove ntpd or openntpd from daemon array.

  • Setting time automatically not working

    My extreme is in bridge mode right now so does it matter if i uncheck the "set time automatically" feature? time.apple.com does not work. Keeps returning me a "no address for ntp server time.apple.com"

    I think its main purpose is to time stamp the activity log reports that the base station can generate - not a feature that the majority of people use.
    Maybe someone else here could elaborate?

  • IPad screen automatically enlarge many times. How to set it back to ragular size?

    My iPad screen automatically enlarge many times, I can not set it back to fit the regular screen size.  I tried to reset it already.  It looks like a huge print book.  No way to operate.  Anybody can shine some light? Thnx.

    Double tap the screen with three fingers to reduce the size.
    Go to Settings>General>Accessibility>Zoom and turn this OFF.

  • Location Services: Setting Time Zone... Always Active

    Just wondering if anybody else is experiencing the always active SETTING TIME ZONE setting in LOCATION SERVICES / SYSTEM SERVICES.
    It's always purple - never stops polling for location.
    I've noticed a change in the battery life for my iPhone 4 and I think this is the culprit.
    Is that setting needed for anything in particular or can it safely be turned off?
    Thanks for any advice you have!

    Grrrrrr, now (after the iOS 5.0.1 update), this is happening not only on my iPad, but also on my iPhone 4S, which never had the problem on iOS 5.0.  So, instead of going from 1 to 0 devices having the problem, I've gone from 1 to 2 after the update!  Isn't this the opposite of what was supposed to happen?
    Letting the iPhone sleep for a while, shutting it off and turning it back on, resetting it with home+power, all do nothing.  Weirdly, it *wasn't* doing this right after I did the update; it only started about a day or so later.
    ****Update: and now it's off again, but it did come on for about 10 minutes and then turned off again.  Hmmmmm. I agree that having the status bar icon enabled is a good idea, to at least be able to see when this happens and disable it if you're in a situation where battery life matters.

Maybe you are looking for