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

Re: Refresh Finder view?


  • Subject: Re: Refresh Finder view?
  • From: Christopher Stone <email@hidden>
  • Date: Wed, 03 Apr 2013 17:57:28 -0500

On Apr 03, 2013, at 17:06, Robert Poland <email@hidden> wrote:
I remember you sending a similar fix sometime in the past, but couldn't find when.
In that one you closed the new window instead on deleting it.
Is there a command that will delete it rather than sending it to the trash?
______________________________________________________________________

Hey Bob,

Ah, okay.  That rings a bell.

This is a little slower than the first script, but it does directly delete the file.  (I changed it to a file to make the possibility of error in the shell script safer.)

It it was me I'd give the new file some really out-there name to make sure there was never a collision.  In fact I'd probably serialize the name with a date.

--
Chris


______________________________________________________________________

# Missing Nigel Garvey's kick-ass date routine...

# Shell
set formattedDate to do shell script "date \"+%s\""
# Satimage.osax
strftime (current date) into "%s"

You might do something like this for a name:

set newFileName to "goofy_File_" & (strftime (current date) into "%s") & ".txt"

tell application "Finder"
  tell front window
    tell its list view options

      

      # Fails
      tell column id kind column
        if (get its visible) = true then
          set its visible to false
        else
          set its visible to true
        end if
      end tell

      

      # Fails
      tell column id size column
        if (get its visible) = true then
          set its visible to false
        end if
      end tell

      

      # Works
      tell column id name column
        if (its sort direction) = normal then
          set its sort direction to reversed
        else
          set its sort direction to normal
        end if
      end tell

      

    end tell

    

    # Force the window to update after changing the sort
    set newFile to (make new file at (its target as alias) with properties {name:"wtf.txt"}) as alias
    set _posix to quoted form of (POSIX path of newFile)
    do shell script "rm " & _posix

    

  end tell
end tell

 _______________________________________________
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: 
 >Refresh Finder view? (From: Robert Poland <email@hidden>)
 >Re: Refresh Finder view? (From: "koenig.yvan" <email@hidden>)
 >Re: Refresh Finder view? (From: Robert Poland <email@hidden>)
 >Re: Refresh Finder view? (From: Alex Zavatone <email@hidden>)
 >Re: Refresh Finder view? (From: Christopher Stone <email@hidden>)
 >Re: Refresh Finder view? (From: Christopher Stone <email@hidden>)
 >Re: Refresh Finder view? (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Passing InDesign variables from one script to an other
  • Next by Date: Re: Passing InDesign variables from one script to an other
  • Previous by thread: Re: Refresh Finder view?
  • Next by thread: Safari
  • Index(es):
    • Date
    • Thread