Because the key that holds the time zone key name varies between XP and more recent versions of Windows, I start by pulling the Windows version, and change the key name accordingly before reading the register for time zone and cities.
Code: Select all
on mouseUp
put queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") into WVersion
put WVersion into buff
if char 1 to 10 of buff = "Windows XP" then
put "StandardName" into zname
else
put "TimeZoneKeyName" into zname
end if
put queryRegistry("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\" & zname) into TimeZ
//We look for a key called Display and return the cities
put queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Romance Standard Time\Display") into cities
answer TimeZ & "/" & cities
end mouseUp