Re: Find/replace
Re: Find/replace
- Subject: Re: Find/replace
- From: Paul Scott <email@hidden>
- Date: Tue, 18 Aug 2009 16:02:19 -0700
I'm sure there're a billion ways to do what you want, but here's a
routine I use to get a substring.
(* FUNCTION DEFINITION*)
on GetSubString of str from fromIndex thru toIndex
if fromIndex is less than 1 then
set fromIndex to 1
end if
if toIndex is greater than (count of str) then
set toIndex to count of str
end if
set tmp to ""
repeat with c in characters fromIndex thru toIndex of str
set tmp to tmp & c
end repeat
return tmp
end GetSubString
set str to "0050_2010_winners_accessories"
GetSubString of str from 6 thru length of str
On Aug 18, 2009, at 3:52 PM, Robert Poland wrote:
Wizards,
I am trying to do a script that will strip the leading 5 characters
from file names.
For example I want "0050_2010_winners_accessories" to become
"2010_winners_accessories".
In my current script I'm trying use these lines, where the "?" would
be a wild card. Apparently the "?" is not valid for this.
property searchStrings : {"00\?\?_"}
property replacementStrings : {""}
TIA,
Bob Poland - Fort Collins, CO
_______________________________________________
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: | |
| >Find/replace (From: Robert Poland <email@hidden>) |