• 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: Getting file suffix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting file suffix


  • Subject: Re: Getting file suffix
  • From: AndrĂ© Renault <email@hidden>
  • Date: Mon, 13 Sep 2010 07:38:12 -0400

You should ask the Finder for the file suffix.

tell app "Finder" to get the name extension of thisFile
On Sep 13, 2010, at 6:27 AM, LuKreme wrote:

> I have a folder action I'm working on where I am trying to get the suffix of a file name that has been dropped into the folder
>
> I have the following bit of code in the main routine:
>
> display dialog "Getting File Suffix"
> if this_item contains "." then
> 	set oldDelims to AppleScript's text item delimiters
> 	set AppleScript's text item delimiters to "."
> 	set item_suffix to text item -1 of this_item
> 	set AppleScript's text item delimiters to oldDelims
> end if
> display dialog "Suffix is " & item_suffix
>
> I get the first dialog, but not the second, and the script appears to have stopped at this point as no further processing occurs.
>
> The only thing that I see in console.app is
>
> /System/Library/CoreServices/AppleScript Runner.app/Contents/MacOS/AppleScript Runner[95306]	CPSGetFrontProcess(): This call is deprecated and should not be called anymore.
>
> Since it's in a folder action, I don't know of anyway to trace its events and replies in script editor.
>
> tempted to rewrite the whole thing as a bash script with a UserAgent...
>
> --
> We will fight for Bovine Freedom and hold our large heads high We will
> run free with the Buffalo or die
>
> _______________________________________________
> 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

 _______________________________________________
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: Getting file suffix
      • From: Luther Fuller <email@hidden>
References: 
 >Getting file suffix (From: LuKreme <email@hidden>)

  • Prev by Date: Re: Getting file suffix
  • Next by Date: Re: Getting file suffix
  • Previous by thread: Re: Getting file suffix
  • Next by thread: Re: Getting file suffix
  • Index(es):
    • Date
    • Thread