• 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: Looking for script that replaces last chars and replace it by .jpg
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for script that replaces last chars and replace it by .jpg


  • Subject: Re: Looking for script that replaces last chars and replace it by .jpg
  • From: Emmanuel <email@hidden>
  • Date: Fri, 16 Jan 2004 16:11:03 +0100

At 2:59 AM +0100 16/01/04, SVEN AERTS wrote:
>Hi,
>
>I have about 400 pics. that have too long names.
>The .jpg drops and is necessary.

(I don't have a dog, so ...)

Use "text i thru j" to extract a substring. What is convenient is that you can use negative indices, for instance you would get the extension with "text -4 thru -1 of theName".

Then use the concatenation operator "&" to concatenate sub-strings.

Like:

--------------------
set theName to (text 1 thru 27 of theName) & (text -4 thru -1 of theName)
--------------------

If the extension's length is not fixed (e.g. you have jpg and you have jpeg), you've got to use "offset" to find out where exactly the "." is.

Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • First time script ... help for debugging
      • From: SVEN AERTS <email@hidden>
    • Re: Looking for script that replaces last chars and replace it by .jpg
      • From: SVEN AERTS <email@hidden>
References: 
 >Looking for script that replaces last chars and replace it by .jpg (From: SVEN AERTS <email@hidden>)

  • Prev by Date: Re: handling Unicode text
  • Next by Date: Re: Timed watched folders
  • Previous by thread: Re: Looking for script that replaces last chars and replace it by .jpg
  • Next by thread: Re: Looking for script that replaces last chars and replace it by .jpg
  • Index(es):
    • Date
    • Thread