• 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: reveal ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reveal ?


  • Subject: Re: reveal ?
  • From: "Stockly, Ed" <email@hidden>
  • Date: Wed, 16 Jan 2019 00:53:00 +0000
  • Thread-topic: reveal ?

I recall that if the folder window was already open then reveal would have no
effect, and would not update to show a newly created or changed item, but, if
the window was closed, reveal would open the window and work pretty flawlessly.

I also use finder's "update" command which you can send directly to the folder
with the item.

So:

Tell application "Finder"
   Close window 1
   Update myDirectory
   Reveal myChangedFile
end

I also have an ASOBjC command from Shane that does something similar and I use
with the Finder update command. It may make reveal work better too.


use framework "AppKit"

use script "FileManagerLib" version "2.0"

use scripting additions


on UpdateDirectory(directoryToUpdate)

local directoryToUpdate, directoryToUpdatePosix

try

set directoryToUpdatePosix to POSIX path of directoryToUpdate

current application's NSWorkspace's sharedWorkspace()'s
noteFileSystemChanged:directoryToUpdatePosix

tell application "Finder"

update (directoryToUpdate as alias) ¬

necessity false ¬

without registering applications

end tell


on error errMsg number errNum

errMsg

end try

end UpdateDirectory

From: AppleScript-Users
<applescript-users-bounces+ed.stockly=email@hidden<mailto:applescript-users-bounces+ed.stockly=email@hidden>>
 on behalf of Christopher Stone
<email@hidden<mailto:email@hidden>>
Date: Tuesday, January 15, 2019 at 4:40 PM
To: AppleScript Digest
<email@hidden<mailto:email@hidden>>
Subject: Re: reveal ?

On 01/14/2019, at 22:48, Jean-Christophe Helary
<email@hidden<mailto:email@hidden>> wrote:
I'm finding that in some cases "reveal" does reveal a file in Finder (select
it) and in some cases it doesn't.
________________________________

Hey Jean-Christophe,

I don't remember seeing reveal fail – except in rare cases where I'd just
created a file using a shell script.

Usually adding a pause corrected that problem.

--
Take Care,
Chris

 _______________________________________________
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

  • Follow-Ups:
    • Re: reveal ?
      • From: Christopher Stone <email@hidden>
References: 
 >reveal ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: reveal ? (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: reveal ?
  • Next by Date: Holding a Key Down or Releasing It
  • Previous by thread: Re: reveal ?
  • Next by thread: Re: reveal ?
  • Index(es):
    • Date
    • Thread