Re: How do I delete the 1st three characters from a variable
Re: How do I delete the 1st three characters from a variable
- Subject: Re: How do I delete the 1st three characters from a variable
- From: Mark Lively <email@hidden>
- Date: Tue, 3 Jan 2006 15:34:37 -0500
On 1/3/06, Patrik B. <email@hidden> wrote:
> Hi,
>
> I am trying to replace images that are in one language with those of
> another. I.e. DAN-image.eps to ENG-image.eps.
>
> The problem I have is I don't know how to delete the 1st three characters.
>
> This is what I tried.
>
> set myimage to "DAN-image.eps"
> copy myimage from offset 4 to mynewimagename -- this is the approach I tried
>
> Then I have a handler that adds the prefix "ENG-" again.
>
> Does anybody know how to do this? It is probably very simple but I have not
> learned how delete individual strings from a variable in order to form a new
> variable. If you know how please let me know!
>
> Best, Patrik
set myImageName to text 4 through -1 of myImageName
you could also use offset as well incase 3 letters turns into 4 (nah,
that would never happen ;) )
set myImageName to text (offset of "-" in myImageName) through -1 of myImageName
-Mark
Many ways to do it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden