• 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
Finder weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finder weirdness


  • Subject: Finder weirdness
  • From: Walter Bushell <email@hidden>
  • Date: Thu, 11 Nov 2010 12:55:54 -0500

Finder throws an error from the command it gets, which command runs by itself.

That is when I run the command that appears in the results and events window which throws an error, it runs. ?????

I think Finder is weird, better to do as much work as possible in Eunuchs.


I try
set x to (POSIX file "/Users/Walter/Music/YourBrain 000.pdf")
--tell application "QuickTime Player" to open x
tell application "Finder"
	log x
	my dostuff(x)
end tell

on dostuff(x)
	set y to name of (info for x)

	tell application "Finder"
		set the name of x to "y" & text -7 thru -5 of y & ".pdf"
		set name of x to "x" & text -7 thru -5 of name of x & ".pdf"
	end tell
end dostuff
--------------
and get
---------
tell application "Finder"
	(*file After Ewe:Users:Walter:Music:YourBrain 000.pdf*)
end tell
tell current application
	info for file "After Ewe:Users:Walter:Music:YourBrain 000.pdf"
		--> {name:"YourBrain 000.pdf", creation date:date "Sunday, March 15, 2009 7:53:38 PM", modification date:date "Sunday, March 15, 2009 7:53:38 PM", size:54474, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:"pdf", displayed name:"YourBrain 000.pdf", default application:alias "After Ewe:Applications:Preview.app:", kind:"Portable Document Format (PDF)", file type:"", file creator:"", type identifier:"com.adobe.pdf", locked:false, busy status:false, short version:"", long version:""}
end tell
tell application "Finder"
	set name of file "After Ewe:Users:Walter:Music:YourBrain 000.pdf" to "y000.pdf"
		--> error number -1728
Result:
error "Finder got an error: Can’t set name of file \"After Ewe:Users:Walter:Music:YourBrain 000.pdf\" to \"y000.pdf\"." number -10006 from name of file "After Ewe:Users:Walter:Music:YourBrain 000.pdf"
------------------------
but when I try

tell application "Finder"
	set name of file "After Ewe:Users:Walter:Music:YourBrain 000.pdf" to "y000.pdf"
end tell
-------------------
it works and changes the file name

--
A unix salesperson, Lenore/Loved her job, but loved the beach more. She devised a way to combine work and play:/She sells C-shells by the seashore

 _______________________________________________
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: Finder weirdness
      • From: KOENIG Yvan <email@hidden>
    • Re: Finder weirdness
      • From: Deivy Petrescu <email@hidden>
    • Re: Finder weirdness
      • From: "Stockly, Ed" <email@hidden>
  • Prev by Date: Re: Scripting Adobe PhotoShop CS5
  • Next by Date: Re: Finder weirdness
  • Previous by thread: Re: Scripting Adobe PhotoShop CS5
  • Next by thread: Re: Finder weirdness
  • Index(es):
    • Date
    • Thread