• 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: How can I control invisible files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I control invisible files


  • Subject: Re: How can I control invisible files
  • From: Doug McNutt <email@hidden>
  • Date: Sat, 03 Nov 2012 12:38:52 -0600

At 21:17 -0600 11/2/12, Robert Poland wrote:
>Hi,
>
>I like Doug's approach but I'm having trouble with the syntax.
>
>tell application "Finder"
>	set winTarget to target of front window as alias
>end tell
>
>set fileList to list folder winTarget with invisibles
>
>if fileList contains ".DS_Store" then
>	set _file to quoted form of (POSIX path of (winTarget as text) & ".DS_Store")
>	do shell script "sudo cp /dev/null  _file"
>end if
>

It never ceases to amaze me that AppleScript can be so much more obtuse than perl or shell scripting.

sudo may need something like "with administrator privileges"

(winTarget as text) & ".DS_Store") might need a solidus depending on whether or not it's automatically included in the target request. (winTarget as text) & "/" & ".DS_Store"). Printing out the contents of  _file would be good debugging.

Remember that do shell script requires full path names for everything.  The new shell it brings each time has no knowledge of your current working directory.  I do think you have that OK here but don't forget it.

And you also might need to draw some concentric red and black circles in the window to give the term "target" something to aim at.
--

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
 _______________________________________________
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: How can I control invisible files
      • From: Robert Poland <email@hidden>
References: 
 >How can I control invisible files (From: Robert Poland <email@hidden>)
 >Re: How can I control invisible files (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: How can I control invisible files
  • Next by Date: Re: Mail navigation script
  • Previous by thread: Re: How can I control invisible files
  • Next by thread: Re: How can I control invisible files
  • Index(es):
    • Date
    • Thread