Topic Options
#33527 - 10/07/10 08:02 AM Rename action to delete first 2 caracters
vlaardim Offline
OL Newbie

Registered: 03/12/10
Posts: 20
Loc: The Netherlands
How can I use the rename action for renaming a PDF into the same name without the first 2 caracters?

regards Marcel

Top
#33528 - 10/07/10 09:19 AM Re: Rename action to delete first 2 caracters [Re: vlaardim]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Marcel,

You'll have to use a vbscript. Fortunately, it isn't a big script at all.

First, add a Set Job Info, and set a job info(we'll use 9 for this example) to %f, that is, the current job name. After that, add a Run Script action with the following script:

Code:
Watch.SetJobInfo 9, mid(Watch.GetJobInfo(9), 3, len(Watch.GetJobInfo(9))-2)


This will remove the first two characters. And finally, add a Rename action and use %9 as the new name. That should rename the file without the first two characters.

Hope that helps!

Regards,
Raphaël Lalonde Lefebvre

Top
#33529 - 10/07/10 09:59 AM Re: Rename action to delete first 2 caracters [Re: Raphael Lalonde Lefebvre]
vlaardim Offline
OL Newbie

Registered: 03/12/10
Posts: 20
Loc: The Netherlands
Hi Raphaël,

I Only see a yellow bar, no vbscript :-/ (newbie...)
Can you mail me the post.?

Marcel

Top
#33530 - 10/07/10 10:00 AM Re: Rename action to delete first 2 caracters [Re: vlaardim]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Here's the code:

Watch.SetJobInfo 9, mid(Watch.GetJobInfo(9), 3, len(Watch.GetJobInfo(9))-2)

Raphaël

Top