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

Re: Finder weirdness


  • Subject: Re: Finder weirdness
  • From: Deivy Petrescu <email@hidden>
  • Date: Thu, 11 Nov 2010 16:50:58 -0500

Ed is right. It is kind of hard to decipher your message.

But here is a clue of what is going on:




set x to (POSIX file "/Users/Walter/Music/YourBrain 000.pdf")
--tell application "QuickTime Player" to open x
tell application "Finder"
	tell me to log x
	tell me to log (class of x)
	try
		name of x
	on error e
		tell me to display dialog e giving up after 5
	end try
	display dialog (get name of (x as alias))
end tell

Finder does not know about furl. Finder has its own items, which other apps do not know about.
Stick with the terminology of the apps you are working with.


On Nov 11, 2010, at 12:55 , Walter Bushell wrote:

> 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

Deivy Petrescu
email@hidden



 _______________________________________________
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: 
 >Finder weirdness (From: Walter Bushell <email@hidden>)

  • Prev by Date: Re: text returned to record
  • Next by Date: Re: Finder weirdness
  • Previous by thread: Re: Finder weirdness
  • Next by thread: Re: Finder weirdness
  • Index(es):
    • Date
    • Thread