Error in applescript to fix dates with GMT shift

Hello,
I am attempting to fix a problem with importing OFX files from the bank's website. Therein, dates are stored this way:
<DTPOSTED>20110106000000[+9.0:JST]
The time zone indicator causes Numbers to incorrectly compensate dates, resulting in one day earlier than the correct date to be displayed. Removing [+9.0:JST] fixes the problem, but that is tedious to fix many entries. Thus I thought to write an applescript to fix this issue.
This is the script I wrote:
tell application "Numbers"
tell document 1
set currentSheet to 0
repeat with i from 1 to the count of sheets
tell sheet i
set x to the count of (tables whose selection range is not missing value)
end tell
if x is not 0 then
set the currentSheet to i
exit repeat
end if
end repeat
tell sheet currentSheet
set the currentTable to the first table whose selection range is not missing value
tell the currentTable
repeat with theCell in every cell in selection range
set theValue to value of theCell
set theNewValue to ((theValue) + (time to GMT)) as date
set value of cell theCell to ((date string of theNewValue) as date)
end repeat
end tell
end tell
end tell
end tell
However this error occurs:
error "Can’t make "2011.1.09" into type date." number -1700 from "2011.1.09" to date
It appears there are problems with how Numbers 2009 deals with date formats, but I have not been able to understand how to make this work.
The English discussions forum seems more active than the Japanese, so I am asking here hoping someone can help. Thank you in advance.

Hello Hiroto
(1) Best wishes fro the new year my friend
(2)
To get your script running I had to edit it this way :
For Numbers '09, which has specific defect in getting date value from cell by AppleScript.
tell application "Numbers"
tell document 1
-- omitted (same as the original)
tell sheet 1 --currentSheet
-- omitted (same as the original)
tell table 1 --currentTable
repeat with theCell in (get every cell of selection range)
set theCell to theCell's contents
set value of theCell to (((value of theCell) + (my get_diff2UTC())) as string) -- [2]
end repeat
end tell
end tell
end tell
end tell
[1] Due to Numbers' AppleScript's defect, when getting date value of cell by AppleScript,
the retrieved date is in local time calculated as follows :
<retieved date value> = <stored date value> + <time to UTC>
[2] When setting date value of cell by AppleScript, the stored value is the same as the source value.
on get_diff2UTC()
return -(time to GMT)
end get_diff2UTC
The handler is due to a Snow Leopard new feature
When we trigger a command belonging to an other sdef than the one of the application owning the block we get an error.
Some times this one doesn't hurt, sometimes it does.
Here, calling time to GMT in the tell Numbers block generate an error which doesn't hurt but I dislike this kind of thing and decided to trigger it from the outside of the block.
Here is the log report when triggering time to GMT from the tell Numbers block :
tell application "Numbers"
get every cell of selection range of table 1 of sheet 1 of document 1
--> {cell "B2" of table "Tableau 1" of sheet "Feuille 1" of document "Sans titre"}
time to GMT
--> error number -10004
end tell
tell application "AppleScript Editor"
time to GMT
--> 3600
end tell
tell application "Numbers"
get value of cell "B2" of table "Tableau 1" of sheet "Feuille 1" of document "Sans titre"
--> date "vendredi 14 janvier 2011 14:52:10"
set value of cell "B2" of table "Tableau 1" of sheet "Feuille 1" of document "Sans titre" to "vendredi 14 janvier 2011 13:52:10"
end tell
Now, here is the log report when I use the handler :
tell application "Numbers"
get every cell of selection range of table 1 of sheet 1 of document 1
--> {cell "B2" of table "Tableau 1" of sheet "Feuille 1" of document "Sans titre"}
end tell
tell application "AppleScript Editor"
time to GMT
--> 3600
end tell
tell application "Numbers"
get value of cell "B2" of table "Tableau 1" of sheet "Feuille 1" of document "Sans titre"
--> date "vendredi 14 janvier 2011 14:52:10"
set value of cell "B2" of table "Tableau 1" of sheet "Feuille 1" of document "Sans titre" to "vendredi 14 janvier 2011 13:52:10"
end tell
Yvan KOENIG (VALLAURIS, France) vendredi 14 janvier 2011 15:56:45

Similar Messages

  • Error when unloading xmltype column data with the size over 30kb.

    Hello there,
    I got the following error when I called a function to unload xmltype data column with the size over 30k.
    ERROR at line 1:
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 140
    ORA-06512: at "SYS.UTL_FILE", line 379
    ORA-06512: at "SYS.UTL_FILE", line 1062
    ORA-06512: at "ARGCS.ARGCS_UNLOAD_TO_XMLFILE", line 56
    ORA-06512: at line 1
    Would anyone please help?
    Thanks.
    tbluong.

    Hello there,
    I got the following error when I called a function to unload xmltype data column with the size over 30k.
    ERROR at line 1:
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 140
    ORA-06512: at "SYS.UTL_FILE", line 379
    ORA-06512: at "SYS.UTL_FILE", line 1062
    ORA-06512: at "ARGCS.ARGCS_UNLOAD_TO_XMLFILE", line 56
    ORA-06512: at line 1
    Would anyone please help?
    Thanks.
    tbluong.

  • TS1389 -42110 error? why not fix it with an update?

    is apple even aware of this error? can i have a fix that actually works?

    i can't see it on my chromebook wifi
    iPhone 5s, iOS 8.1.3

  • Value of the variable FISCYEAR to compare it with a fix date

    Hi,
    I'm using a hierarchy in my query. But in some case I have to multipliy the value in one column depending wich year is shown. So I tried to use a formular variable. But it doesn't work. Has somebody an idea what to do?
    How can I extract the value of the variable FISCYEAR to compare it with a fix date?
    Problem:
    ........................|  Year 1 (2005)       |  Year 2 (2006)        |   Year 3 (2007)
    hierarchy row 1  | query result 11      | query result 12       | query result 13
    hierarchy row 2  | query result 21      | query result 22       | query result 23
    hierarchy row 3  | query result 31      | query result 32       | query result 33 => row is hidden
    formular row 4   | IF Year == 2005    | IF Year == 2005     | IF Year == 2005 
                             THEN                   | THEN                    | THEN                   
                            query result 31 *10 | query result 32 *10 | query result 33 *10
                            ELSE                     |ELSE                    | ELSE                   
                            query result 31       | query result 32       | query result 33

    The If Statement is no problem.
    I need the value of the variable FISCYEAR. So the value of the variable is the If-Statement. I tried to use a formula variable but don't get correct values. With BW 2004 I used the text and compared it with the string "2005". BW 2004s gives me the error message the if using the text, the value of the variable depends on the language which is not supported

  • Error crating AIR file: notafter {date time} (Publish   with flex)

    I publish AIR file with Flex builder
    but it said Error crating AIR file: notafter follow with date
    and time
    How can I fix it?

    I have the same problem. Does anyone know how to fix this
    ?

  • I have like five GB's of ghost data (data the device claims is not there but it is still taking up space) on my I pad 2 from a failed movie download attempt. How do I fix that with out resting my iPad? I have only 1GB left of storage

    I have like five GB's of ghost data (data the device claims is not there but it is still taking up space) on my I pad 2 from a failed movie download attempt. How do I fix that with out resting my iPad? I have only 1GB left of storage
    The movie had gotten to the point that I could watch it all the way through but it still said processing and got stuck at that point and when I turned off the wifi to try to restart it, it deleted its-self but did not free up any of the storage It was taking up
    Restarting my iPad does not help
    Some thing similar also happened to my old laptop when trying to download the iOS 5 update to my laptop when it came out. It kept getting disconnected and every time it would try to start over and act like what had already been downloaded was not there though it was still taking up the storage space.
    And it continued repeating until it took up all of my storage space. The data file would not show up anywhere so I had to restore my laptop to the factory settings and that worked for awhile but I eventually had to get a new laptop.

    Did you try to set it up as new device, as explained in this article?
    How to erase your iOS device and then set it up as a new device or restore it from backups
    If this does not work, use iTunes to set it back to factory settings, which would also install the latest software:
    Use iTunes to restore your iOS device to factory settings - Apple Support

  • Error while importing data with DTW

    Hi Guys,
    I received an error when i try to upload data with DTW
    method '~' of object '~' failed65171
    When i click on run simulation again,
    I received another error 65172.
    There's two different error.
    Can anyone help?

    Hi,
    This error means that your Obscommon user is corrupt and you  cannot connect to the SBO-Common database to download the  OBServer.dll that is stored in the temporary directory.
    For more information, see SAP Note 858475, 642564, or 614946.
    Thanks & Regards,
    Nagarajan

  • I recently did an update for my iTunes and now when I try to open it, I get an error that says that my data execution prevention is not allowing it to open. How do I fix this issue?

    I recently did an update for my iTunes and now when I try to open it, I get an error that says that my data execution prevention is not allowing it to open. How do I fix this issue?

    Try updating your QuickTime to the most recent version. Does that clear up the DEP errors in iTunes?

  • Sql@loader-704  and ORA-12154: error messages when trying to load data with SQL Loader

    I have a data base with two tables that is used by Apex 4.2. One table has 800,000 records . The other has 7 million records
    The client recently upgraded from Apex 3.2 to Apex 4.2 . We exported/imported the data to the new location with no problems
    The source of the data is an old mainframe system; I needed to make changes to the source data and then load the tables.
    The first time I loaded the data i did it from a command line with SQL loader
    Now when I try to load the data I get this message:
    sql@loader-704 Internal error: ulconnect OCISERVERATTACH
    ORA-12154: tns:could not resolve the connect identifier specified
    I've searched for postings on these error message and they all seem to say that SQL Ldr can't find my TNSNAMES file.
    I am able to  connect and load data with SQL Developer; so SQL developer is able to find the TNSNAMES file
    However SQL Developer will not let me load a file this big
    I have also tried to load the file within Apex  (SQL Workshop/ Utilities) but again, the file is too big.
    So it seems like SQL Loader is the only option
    I did find one post online that said to set an environment variable with the path to the TNSNAMES file, but that didn't work..
    Not sure what else to try or where to look
    thanks

    Hi,
    You must have more than one tnsnames file or multiple installations of oracle. What i suggest you do (as I'm sure will be mentioned in ed's link that you were already pointed at) is the following (* i assume you are on windows?)
    open a command prompt
    set TNS_ADMIN=PATH_TO_DIRECTOT_THAT_CONTAINS_CORRECT_TNSNAMES_FILE (i.e. something like set TNS_ADMIN=c:\oracle\network\admin)
    This will tell oracle use the config files you find here and no others
    then try sqlldr user/pass@db (in the same dos window)
    see if that connects and let us know.
    Cheers,
    Harry
    http://dbaharrison.blogspot.com

  • Error Occuring While Processing Data With DIAdem 8.1Excepti​on EAccessVio​lation in module ntdll.dll at 000111DE. Access violation at address 7C9111DE in module 'ntdll.dll​". Read address 37363430

    Hello,
    We are having an issue running Diadem 8.1 on a new HP XW 9400 with Windows XP SP2. 3 errors have been occuring with frequent crashes, they are:
    1) "1Exception EAccessViolation in module ntdll.dll at 000111DE. Access violation at address 7C9111DE in module 'ntdll.dll". Read address 37363430.
    2) The instruction at "0x7c9111de" referenced memory at "0x352e302d". The memory could not be "read".
     3) ---Error---   DIAdem
    Error in Autosequence - processing in line: 74 (IARV_VAR_GET)
    Runtime Error while executing command "Iarv2Txt$ := FR(T9,L1)"
    Error type: ACCESS VIOLATION
    Error address: 000101DE
    Module name:ntdll.dll
    We are using the same scripts and version 8.1 on a variety of Dell desktop computers (W2K and XP SP2) without any issue, looking for suggestions as this affects no other software on the HP XW 9400 other than DIAdem. Appreciate any suggestions.
    Message Edited by swillh on 06-25-2007 08:55 AM

    Christian,
    I will answer your questions in the text below. Thanks for your help.
    Hi swillh,
    I also would like to help you.
    Unfortunately, The reported access violation in the central Windows ntdll.dll is very unspecific.
    May be the following questions will help you to provide me more info.
    1. You mentioned that the aut's and - I think - also the accessed text file reside on a server.
    Is there a stable network connection?
    The server can sometimes be a little slow but the connection is good. This computer is using the same connection that the prior computer utilized without issue.
    Are the files accessed by multiple clients simultaneously?
    It is possible that more than one computer can be accessing the same file, but again, this has never been an issue. We are reading the files only, not writing to them.
    The processing routines we are running have used for over 5 years without any issues until adding this computer.
    Is the text file read by one client while another client is writing the same file?
    No, files are "read only"
    2. Have you already tested opening the file with the FileOpen command before calling FR?
    Yes
    Do you see any chance to convert the aut to a vbs file? This gives you more alternatives in accessing text files.
    3. What do you mean with "processing ATD's with 30 or more channels of data"? Where is the relation between ATD files and data channels?
    Processing Crash Dummy data with file sets low in channel count (15 channels) result in successful processing without any crashes or access errors.  When processing dummies with more than 20 channels we sometimes encounter these issues. The higher channel count may be the only common factor I can find in these faults.
    Steve
    Message Edited by swillh on 07-09-2007 08:44 AM

  • Tp ended with error code 0247 - addtobuffer has problems with data- and/or

    Hello Experts,
    If you give some idea, it will be greatly appreciated.
    This transported issue started coming after power outage, sap system went hard shutdown.
    Then we brought up the system. Before that , we do not have this transport issue.
    our TMS landscape is
    DEV QA-PRD
    SED-SEQSEP
    DEV is having the TMS domain controller.
    FYI:
    *At OS level, when we do scp command using root user, it is fine for any TR.
    In STMS, while adding TR in SEQ(QA system), we  are getting error like this.
    Error:
    Transport control program tp ended with error code 0247
         Message no. XT200
    Diagnosis
         An error occurred when executing a tp command.
           Command:        ADDTOBUFFER SEDK906339 SEQ client010 pf=/us
           Return code:    0247
           Error text:     addtobuffer has problems with data- and/or
           Request:        SEDK906339
    System Response
         The function terminates.
    Procedure
         Correct the error and execute the command again if necessary.
    This is tp version 372.04.71 (release 700, unicode enabled)
    Addtobuffer failed for SEDK906339.
      Neither datafile nor cofile exist (cofile may also be corrupted).
    standard output from tp and from tools called by tp:
    tp returncode summary:
    TOOLS: Highest return code of single steps was: 0
    ERRORS: Highest tp internal error was: 0247

    when we do scp using sm69,
    SEDADM@DEVSYS:/usr/sap/trans/cofiles/K906339.SED SEQADM@QASYS:/usr/sap/trans/cofiles/.
    it throws the error like below,
    Host key verification failed.
                                                                                    External program terminated with exit code 1
    Thanks
    Praba

  • Error when querying OLAP data with BI answers

    Have been doing all the Lessons in "Using Oracle OLAP With Oracle BI Enterprise Edition 10g Release 3". Got till lesson 3 where I'm supposed to query the data with Answers but If I add any of the facts to the report, I get the following error:
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17003] Oracle gateway error: Unsupported data type 101. (HY000)
    SQL Issued: SELECT Customer."Ship To" saw_0, Measures.COST saw_1 FROM Global ORDER BY saw_0
    So I was wondering if anyone knows what the catch could be.
    Thanks in advance!

    Yes. Me too. I have the same issue and I don't find any information about it. Could anyone help ?

  • How do you fix error message "There is a problem with Adobe Acrobat/Reader. (6:6)

    How does one fix error message "There is a problem with Adobe Acrobat/Reader.
    If it is running, please exit and try again. (6:6)

    http://www.essexinfo.net/queens-road-residents-association/assets/documents/village-voices is one example but a whole lot of the material which has been uploaded as pdf files over the last four years is now unviewable - if you click on the link you just get a black page.  The main site url is http://www.essexinfo.net and our site is the Queens Road Residents Association.  I have just gone through every link on the site and a number of links when clicked on will not bring up the material.  I tried going into Adobe 10 on my computer and disenabling protected mode as was suggested on your forum and at first when I went back into the essex info site it seemed to have worked when I clicked on a link that had only produced a black page.  However when I went back to test all the other links I found that the problem was still re-occuring.  This is really weird as the site and my connections to it which I sometimes make by directly accessing the site and sometime via a link from our QRRA blog have always worked perfectly with no problems up to now.  I downloaded adobe 10.1 on 8 March 2011.
    I contacted essexinfo separately but they said everything seemed to be OK at their end working from within the system.
    If you can help I would appreciate it.
    Pat

  • IOS 7 error message, now phone says up to date with version 6.1.3

    Earlier in the day I tried updating to iOS 7. Of course, it didn't work.  I tried a few hours later and it looked like it was working - it went to the Apple screen and started downloading, then it stopped and stayed the same.
    I went back into the System Update and it searched for a good 15 minutes for an update then said an error ocurred while trying to search for an update.  I tried a couple more times with the same result, then it told me it was up to date with 6.1.3.. I turned off my phone and back on and it still says the same thing.  Not sure if or when that's going to change.
    Pretty disappointed considering how excited I was for this dang update.

    I had this same issue with my iPhone 5
    First make sure you back up to the icloud
    Second plug into power
    Third keep tryng it will eventually take
    Hope this helps

  • I can not do the update , what should I do to fix this error ? "There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanks

    I can not do the update , what should I do to fix this error ?
    "There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanks

    Hi,
    Please refer to the help document below:
    Error downloading, installing, or updating Creative Cloud applications
    Regards,
    Sheena

Maybe you are looking for