• 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: issues with a find
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: issues with a find


  • Subject: Re: issues with a find
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 17 Aug 2015 16:36:43 -0500

On Aug 17, 2015, at 3:53 PM, Axel Luttgens wrote:

Let’s say I have a file named "aaa.bbb.ccc" on my desktop.

Strictly speaking, a file’s extension is the part of its name that comes after the last dot, if any; in this case, the extension is "ccc".

On the other hand, since you’re scripting the Finder, the relevant property is "name extension", not "extension".

Be careful about extensions. This is NOT necessarily so.

The part of a file name that appears to the right of the right-most dot
may or may not be an extension (known as 'name extension' to the Finder.)

I ran this script ...

set fileAlias1 to alias "OS_X:Users:lutherfuller:Desktop:Sums.gcx"
set fileAlias2 to alias "OS_X:Users:lutherfuller:Desktop:Sums 2.xyz"
tell application "Finder"
name extension of fileAlias1
display dialog ((name of fileAlias1) as text) & return & "extension = \"" & the result & "\""
name extension of fileAlias2
display dialog ((name of fileAlias2) as text) & return & "extension = \"" & the result & "\""
end tell

(The file "Sums 2.xyz" is a copy of "Sums.gcx" with the "extension" changed.)

You will clearly see that the file fileAlias2 has no extension because 'xyz' is not a recognized extension.



 _______________________________________________
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: 
 >issues with a find (From: Die Fledermaus <email@hidden>)
 >Re: issues with a find (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: How do we Convert PICT to JPEG
  • Next by Date: Re: How do we Convert PICT to JPEG
  • Previous by thread: Re: issues with a find
  • Next by thread: AppleScript UI Guru Needed
  • Index(es):
    • Date
    • Thread