• 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
trouble with finder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trouble with finder


  • Subject: trouble with finder
  • From: tom wible <email@hidden>
  • Date: Sat, 05 Feb 2011 11:27:37 -0500

i just can't seem to grasp applescript's file intricacies:

set these_files to choose file with multiple selections allowed
set PpathList to {}
repeat with f in these_files
	log "f=" & f
	set end of PpathList to POSIX path of f
end repeat
try
	repeat with ppath in PpathList
		log "ppath1=" & ppath
		set ppath to (contents of ppath) as string
		log "ppath2=" & ppath
		tell application "Finder" to move (POSIX file ppath) to trash
	end repeat
on error msg
	log msg
end try
try
	repeat with ff in these_files
		log "ff=" & ff
		tell application "Finder" to move ff to trash
	end repeat
on error msg
	log msg
end try
gives me this:

tell current application
choose file with multiple selections allowed
{alias "toms160gB:Users:tomw:Desktop:program.tvpi", alias "toms160gB:Users:tomw:Desktop:program-1.tvpi"}
(*f=toms160gB:Users:tomw:Desktop:program.tvpi*)
(*f=toms160gB:Users:tomw:Desktop:program-1.tvpi*)
(*ppath1=/Users/tomw/Desktop/program.tvpi*)
(*ppath2=/Users/tomw/Desktop/program.tvpi*)
end tell
tell application "Finder"
move POSIX file "/Users/tomw/Desktop/program.tvpi" to trash
(*Finder got an error: Can't get POSIX file "/Users/tomw/Desktop/ program.tvpi".*)
(*ff=toms160gB:Users:tomw:Desktop:program.tvpi*)
move alias "toms160gB:Users:tomw:Desktop:program.tvpi" to trash
document file "program.tvpi" of trash
(*ff=toms160gB:Users:tomw:Desktop:program-1.tvpi*)
move alias "toms160gB:Users:tomw:Desktop:program-1.tvpi" to trash
document file "program-1.tvpi" of trash
end tell


notwithstanding the out-of-order eventlog, i just can't grok why posix file posixpath fails here...

_______________________________________________
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: trouble with finder
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: excel - hyperlinks errors
  • Next by Date: trouble with finder
  • Previous by thread: Re: excel - hyperlinks errors
  • Next by thread: Re: trouble with finder
  • Index(es):
    • Date
    • Thread