Re: Re Delete
Re: Re Delete
- Subject: Re: Re Delete
- From: Axel Luttgens <email@hidden>
- Date: Fri, 20 Aug 2010 11:47:49 +0200
Le 20 août 2010 à 01:36:28, R. Nelson Byrne a écrit :
> I should mention that, finally having read the error message from System Events, I gave it what it asked for: a reference.
>
>> alias "Hard Time:Desktop Folder:DATAFILE.pdf" returning aFile
>> tell application "Finder" to get size of aFile
>> tell application "System Events" to delete (a reference to aFile)
>>
>
> This works just fine.
>
> Moral: don't ask, just do what you're told.
Mmmm...
The "a reference to" operator is a basic AppleScript thing, and I doubt this has any relationship to what the error message refers to.
System Events clearly shows an inconsistent behavior wrt AppleScript aliases, and it could well be that your usage of "a reference to" just triggers some otherwise overlooked branch of code.
Note that this one "works" well too:
set ASAlias to alias ((path to desktop folder as text) & "testfile")
tell application "System Events"
delete (contents of ASAlias)
end tell
even if it seemingly does right the opposite of what one's told to do...
Frankly, I wouldn't be too confident with such coding... ;-)
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >Re Delete (From: "R. Nelson Byrne" <email@hidden>) |