On 12/16/01 11:52 AM, "Allen Watson" <[EMAIL PROTECTED]> wrote:
> Paul,
>
> Finally got around to trying out your "Sync with Palm" scripts this weekend.
> The scripts basically work, and I am going to find them very, very useful.
Hi, Allen,
Thanks for giving it a workout. I'm a fairly desultory Palm user, so I
haven't been doing much syncing since I finished the scripts, and what i
have done since then has just been a few items at a time. I never hit the
limits you found, but I think I have an idea what they may be. Reply inline.
>
> However, as I feared, since I have been unable to hot sync since starting
> into the beta program back in September, it is taking me hours and hours to
> catch up on my older data. I had to go through things both on the Visor and
> in Entourage X, marking "sync" category on the things I want to sync. I've
> encountered a number of problems along the way, and I am still not done. I
> was able to sync EfX to E2001 with one (big) problem, and then to hot sync
> my Visor to E2001. So, I think my Visor is fairly current with everything!
>
> First, I located all the contacts in X that were modified since October 15
> (anything earlier and I got almost everything; I'm not sure why, probably
> something I did on the 14th. No doubt some script that modified every record
> in the contact database.) There were about 205 of them. I selected them all
> and tried "Sync from X." It ran for a long, long time, and finally, after I
> went away and came back hours later, I found it had died with and Error 1 (I
> believe that's out of memory). I don't know whether it synced all the
> contacts or not; the ones I've spot-checked seem to have been transferred to
> E2001 all right. I hot synced at this point with my Visor, so now E2001 and
> the Visor are in accord with one another.
This one just sounds like a memory issue, and probably a Visor memory issue
at that, since you didn't lose (much) data. I think it's probably safer not
to do everything at once.
>
> Next, I tried to sync the other way: 2001 to X, to transfer anything that
> was on the Visor but not in X. I selected a bunch of notes, contacts, and
> events in E2001 (using the Sync and Sync Delete categories, and the "For
> Sync" custom view). There were perhaps 60 items. On the first attempt,
> selecting all of them, the script Sync from 2001 began to run and then,
> apparently, just hung up doing nothing. I could not see anything happening;
> no disk noise. I switched back and forth between the applet and Entourage,
> saw spinning beach ball in the applet and that's all. I waited about an
> hour; no results. So I Cmd-Period'ed in the applet and it quit. Nothing in
> Entourage had changed; apparently, no items were processed.
It might still have been running. When I did my first tests on large number
of "catch-up" items, I left it all night in the end, and it turned out it
got it all. I thought, later on, that this was merely a question of hidden
dialogs that needed clicking, obscured by window-layering problems of
Classic in OS X. So I fixed that, and everything went fast after that. But i
never tried it on very large amounts of data afterwards so perhaps the size
was the problem after all.
>
> I tried again, selecting just the first 22 items or so. That run completed
> all the way, and the synced items were gone from the list when I switched
> back to E2001; the script had removed the sync categories from the items it
> processed, I presume.
Yes, so you don't have to do it yourself, and so that the next time you sync
2001 to Palm it removes (hopefully) the Sync category and "sync" title
additions from the items on Palm. Otherwise they'll get re-synced to 2001
(which could save you this time - see below.)
>
> I selected the remaining 38 items and did another run. It seemed like
> something was happening, although it was taking a long time. Finally, I
> switched to the applet and found an error message: "Variable contactList is
> not defined". When I clicked on the "Edit" button, I got an error about text
> insertion not working because the length limit would be exceeded. That
> appeared to involve appending info from some contact to some variable...I'm
> not sure. But I think that, somehow, your script, given my data, is running
> into some kind of limit and dying.
Yes, it's probably hitting a limit for list size; total memory available to
the running script. In the past, I've converted these lists to text, written
the text to a file, and then read it back in the importing script. Here, I
ran into a very weird problem: I'm using applets (required because I'm
quitting one version of entourage to open the other), and referring to
'application "Microsoft Entourage"' as a variable using the full path name
to the application file: application EvXStr or E2001Str as the case may be,
with 'using terms from application "Microsoft Entourage"'. I discovered that
the OS remembers the application object "Microsoft Entourage" as Entourage
X no matter what you do any other way, and just opens it again instead of
2001, or tries to. (Actually, worst is trying to quit 2001: when you call
application "Microsoft Entourage", it tries to open X in order to quit it,
and can't, since 2001 is open, so nothing happens at all.)
One unexpected result of all this is that when you're in one of these
variable tell blocks, application constants seem to be read as raw code, not
as the keywords we know. so when trying to save the priority 'normal', for
example, to text, instead of getting
tell application "Microsoft Entourage"
set x to priority of theTask -- normal
set x to x as string -- "normal"
end tell
write x to theFile -- "normal"
and then, in the "other" Entourage:
set x to text item 3 of paragraph 22 of theFile
tell application "Microsoft Entourage"
if x = "normal" then set priority of theTask to normal
end tell
it turned out that it was reading and writing "�constant !nrm�" , not
"normal", and everything was erroring - again silently, as you found. (This
seems to be an unfortunate quirk of OS X.) But if I just stuck the normal
priority in a list, everything came out OK.
It also occurred to me that I didn't need to write to text files, since one
script was running the show. I did wonder whether maybe the lists could get
too big. I guess now I know. there are workarounds for the problem above.
The orthodox method for avoiding this problem, which I have not yet used but
will have to stat doing now, is to not try to retain entire lists in memory,
but write a chunk at a time to a text file. maybe I'll have to do that. that
issue may come up also with my new Export/import scripts I was just about to
release. They _do_ use text files for export, but I was writing the entire
list-as-string to text in one go. I may have to revise that.
>
> The bad part is that when I switched back into Entourage 2001, most of the
> items in the custom view had disappeared; the sync category had been removed
> from all the items processed. However, since the script didn't complete,
> none of those items made it into EfX! And I'm not sure exactly what ones
> they were. I thought that, perhaps, if I ran the script again on a single
> item, it would find the existing data and append the one new thing to it,
> and then continue with the import into EfX. Alas! It seems to have just
> imported the one new item; I don't know what happened to the interim data
> from the first run. Is there a temp file somewhere I could somehow get
> imported into X? Or one I should just delete?
No, the data has disappeared except: if you haven't run the script again,
you could open it in Script debugger, and look at Properties and Globals:
everything is retained in the script until you run it again. If you've
already re-run it once (I think you have), it's too late.
*** But if you haven't synced 2001 to Palm again, then all the "Sync" items
are still in Palm: if you do a Handheld-Overwrites-Entourage sync, you'll
get them all back into your Sync Custom View in 2001, and can run the script
selecting 20 or so items at a time. It won't matter if some of them have
already been transferred to X: they won't duplicate, they'll just replace
existing items with fresh versions of what you're syncing.
>
> It seems I'm going to have to repeat the laborious process of scanning
> through my contacts, tasks, and events and flagging things with the
> appropriate category. At this point, I'm ready to give up on trying to
> recover older items, and just go on with new ones as they occur.
Try the above, if it's not too late (if you still have "Sync" category and
titles in your Visor.)
>
> You may (or may not) want to look into the size limits I've apparently run
> into. As far as I'm concerned it isn't necessary...if I notice a missing
> event, note, contact or task in EfX, I'll just flag them one at a time for
> sync. There does not appear to be any problem with small numbers of items.
> I'm very impressed with the work you've done on these scripts, Paul! It
> occurs to me that they can answer the need several people have voiced to be
> able to sync E2001 and EfX...except for mail, of course. But people <could>
> do that part manually with Advanced Find and drag and drop of folders.
Supposedly, you can't sync mail in Palm anyway. But, yes, if you found a way
to do multi-mail, just drag messages from Custom Views of Recent mail (since
last time) to disk and drag into the other Entourage (maybe copy them into
one or two folders first and just drag the folder: then apply All Rules to
them when you get them into the importing Entourage and they'll all end up
in the correct folders there).
I should probably just add a stronger warning to the "Catch Up" section of
ReadMe, and right at the top, to sync no more than 20 or so items at a time
(Contacts, especially, which have to iterate through 50 or so properties,
even if they're empty, must make for enormous lists.)
>
> Knowing my own air-headedness, I'm sure that I will forget to give things
> the "Sync" category, or will just delete them instead of giving them the
> "Sync Delete" category. I may be moved to write a script that finds all
> items modified since Date X and insures that "sync" is appended to the
> subject or title.
You can't do that, Allen, or I would have done it in the first place instead
of inventing this Custom View business. Why do you think I came up with such
an awkward workaround? Only Contact has a 'date modified' property in
applescript. I've asked for a 'date modified' property for all the other
objects several times, but we've not (yet?) got it. It certainly exists in
the application, since Custom Views in Entourage X can find Date Modified of
Tasks and Notes as well as Contacts - but not Calendar Events! (And Palm
can't do any of this.) so you can certainly make your own Custom Views of
separate contacts, tasks and notes by date modified, select these items, and
run the script. All that matters is selection of items - you can run the
script from anywhere. You don't need to modify it at all. It will run on
your selected items however you found them - and it won't error because they
don't have the Sync category - that's OK. (I don't know what you'll do about
events, however.)
Will you join with me in pestering Dan to add a Date Modified property in
AppleScript for all items? (It should result in the date created if there
has been no modification.)
In the meantime, I'll consider methods for not running out of memory...
Thanks a lot for the feedback.
>That won't help with deleting things, though! So, I pray
> that Palm gets its a** in gear and that Microsoft gets a hot sync patch out
> to us all real, real soon.
That's for sure...
--
Paul Berkowitz
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
To search the archives:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>