Re: Deleting files
Re: Deleting files
- Subject: Re: Deleting files
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 07 Mar 2004 18:12:31 -0800
On 3/7/04 5:51 PM, "Deivy Petrescu" <email@hidden> wrote:
>
At 3:38 PM -0800 3/7/04, Paul Berkowitz wrote:
>
> On 3/7/04 1:13 PM, "Emmanuel" <email@hidden> wrote:
>
>
>
>> At 9:14 AM +0100 07/03/04, Bernard Azancot wrote:
>
>>> Thanks everybody.
>
>>> Your answers were very helpful.
>
>>>
>
>>> Now everything works fine... BUT I would like to understand 2 points:
>
>>> 1- What is the exact result of the "update
>
> desktop " command ? In what case
>
>>> should I use it ?
>
>> At this step, and since you seem to be
>
> satisfied with the replies you've got,
>
>> it would certainly be interesting if you could find a minute telling us how
>
>> you have it work finally, and for instance
>
>> whether "update desktop" was of any
>
>> help.
>
>>
>
>> Suppose that another listee asks the same question in weeks, and it happens
>
>> some day when you don't have time to reply -
>
>> or maybe you're unsubscribed, or
>
>> maybe still worse - then one of us could relay your experience.
>
>
>
> I'm curious too. I also suggested 'update desktop' in the hope that it would
>
> work reliably here, as it often seems to. 'update' is "advertised" as the
>
> command which sets the visible view on your screen to the Finder changes you
>
> have made by script, but I suspect there's more to it than that. It must
>
> save and reconcile the records kept in the file system, or wherever the
>
> Finder goes to look for its data, to the changes you just made in memory,
>
> rather like saving a database (e.g. Address Book's 'save addressbook'
>
> command). So when the Finder moves on to the next command, everything is as
>
> it should be and it can continue with the next step. Or something like that.
>
>
>
> --
>
> Paul Berkowitz
>
>
Let me join this group of curious people. I have
>
no clue as to why update would make the slightest
>
difference in this case.
>
If there are 3 files in the desktop A, B, C.
>
The script deletes one, say A. whatever is the
>
database that the Finder keeps, it still must
>
have B and C there. Nothing was done to these
>
files!
>
So delete file B should work whether or not one updated the Finder (database).
>
The "something like that" I can think of is the
>
Finder checking this database for every command
>
that one way or another uses the database (i.e.,
>
the file exists or not), which would make
>
"Finder" scripts significanlty slower, I'd assume.
>
Since I do not remember reading, what is your OS Bernard? And AS, SE?
>
Thanks
It might be that the desktop is "busy" and can't tend to the next command
unless you add 'update': update might ensure that the script receives a
message back back from the Finder that it's now no longer busy.
The thing about 'delete' from the Standard Suite is that - like 'save'
(which is not in the Finder dictionary) but not many other commands - it
does not return a result. [1] So the script must move on to the next command
after a 'delete' even if the Finder is still in the process of moving it to
the trash and the desktop is busy. 'update' probably waits until the "all
clear" before allowing the script to proceed.
[1] 'move' and 'duplicate' return results, but I think that AppleScript
doesn't always wait for the result, unlike other commands. Back in Classic,
this created a lot of trouble, and I ended up always using Jon's or Akua. It
doesn't seem to be a problem in OS X.
Bernard, what is your OS? (echo)
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.