• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determine if file is already open
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Determine if file is already open (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Ideas to delete duplicate emails from Inbox?
  • Next by Date: Re: Parsing Large Text Files
  • Previous by thread: Re: Determine if file is already open
  • Next by thread: Re: Determine if file is already open
  • Index(es):
    • Date
    • Thread