Re: Determine if file is already open
Re: Determine if file is already open
- Subject: Re: Determine if file is already open
- From: EBI Aktivitet <email@hidden>
- Date: Sun, 04 May 2008 17:36:04 +0200
- Thread-topic: Determine if file is already open
My guess is that this is what you are looking for. The handler will return
true if the file is open with write access, and false if it is not...
Regards, Adim
-----Script starts-------
set theFilePathMac to "Macintosh HD:test.txt"
doCheckIfFileOpen(theFilePathMac)
on doCheckIfFileOpen(theFilePathMac)
try
set theFileRef to open for access file theFilePathMac with write
permission
close access theFileRef
return false
on error
return true
end try
end doCheckIfFileOpen
----Script ends--------
--
Adim Lundin
EBI AB
www.ebi.se
> On 08-05-02, at 14:04, Raymond P Reedy wrote:
>
>> Before I issue an "Open File" command to the Finder, how do I
>> determine if the file is already open?
_______________________________________________
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