• 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: Last One - Replacing Chars of file name - I HATE TIDs.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Last One - Replacing Chars of file name - I HATE TIDs.


  • Subject: Re: Last One - Replacing Chars of file name - I HATE TIDs.
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 24 Aug 2001 19:24:29 -0700

On 8/24/01 9:05 PM, "T.J. Mahaffey" <email@hidden> wrote:

> Ok, I'm giving up. I tried the following script in various versions and it
> does nothing. No error, no nothing.

It does almost everything.

But if you actually want to RENAME the file (as I imagine you do), then you
have to tell the Finder to do that. You haven't done that:

set name of thisFile to theText -- inside the Finder block

see below:

>
> on open theFileList
> repeat with thisFile in theFileList
> tell application "Finder"
>
> set {AppleScript's text item delimiters, oldTIDs} to {" ",
> AppleScript's text item delimiters}
>
> set theText to name of thisFile as string

-- 'name' property already is a string, you don't need 'as string'
here
>
> set AppleScript's text item delimiters to " "

set AppleScript's text item delimiters to {" "}
-- is actually more accurate, although yours would work by a
coercion
>
> set textList to text items of theText
>
> set AppleScript's text item delimiters to "_"

set AppleScript's text item delimiters to {"_"}
>
> set theText to textList as string
>
> set AppleScript's text item delimiters to oldTIDs

set name of thisFile to theText

> end tell
> end repeat
> end open
>



--
Paul Berkowitz


References: 
 >Last One - Replacing Chars of file name - I HATE TIDs. (From: "T.J. Mahaffey" <email@hidden>)

  • Prev by Date: Last One - Replacing Chars of file name - I HATE TIDs.
  • Next by Date: Re: Last One - Replacing Chars of file name - I HATE TIDs.
  • Previous by thread: Last One - Replacing Chars of file name - I HATE TIDs.
  • Next by thread: Re: Last One - Replacing Chars of file name - I HATE TIDs.
  • Index(es):
    • Date
    • Thread