• 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: Find/replace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Find/replace
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Find/replace (From: Robert Poland <email@hidden>)

  • Prev by Date: Find/replace
  • Next by Date: Re: Open command in Photoshop CS3
  • Previous by thread: Find/replace
  • Next by thread: Re: Find/replace
  • Index(es):
    • Date
    • Thread