Re: Wildcard find/replace in Automator



nomis <ghostbrain@xxxxxxxxxxxxxxx> wrote:

> Anybody know if it's possible to do a wilcard search/replace in
> Automator? I'm trying to create an action that, among other things,
> strips the "(1 of 2)" that I get added to the end of multipart messages
> I download from usenet, but the problem is sometimes it's (1 of 3), or
> even worse, if the title is too long, all I get is "(1 of" or something
> equally abbreviated.
>
> I'd like to tell Automator "strip the first parenthesis and everything after".
>
> Anyone have thoughts how to do so?

One of the included Automator actions is a general AppleScript action
("Run AppleScript"), so you can just write this yourself:

on run {input, parameters}
set x to offset of "(" in input
if x > 0 then
return text from character 1 to character (x - 1) of input
end if
return input
end run

m.

--
matt neuburg, phd = matt@xxxxxxxxxxx, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/exec/obidos/ASIN/0596005571
Read TidBITS! It's free and smart. http://www.tidbits.com
.



Relevant Pages

  • Wildcard find/replace in Automator
    ... Anybody know if it's possible to do a wilcard search/replace in Automator? ... I'm trying to create an action that, among other things, strips the "" that I get added to the end of multipart messages I download from usenet, but the problem is sometimes it's, or even worse, if the title is too long, all I get is "(1 of" or something equally abbreviated. ...
    (comp.sys.mac.apps)
  • Re: Wildcard find/replace in Automator
    ... Automator? ... I'm trying to create an action that, among other things, strips the "" that I get added to the end of multipart messages ...
    (comp.sys.mac.apps)