Welcome to MacForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Renaming files in Automator

 
   Macintosh computer (Home) -> General Discussion RSS
Next:  How to convert WMV to iPad on Mac OS?  
Author Message
Geico Caveman

External


Since: Jan 08, 2010
Posts: 6



(Msg. 1) Posted: Fri Jan 07, 2011 1:09 am
Post subject: Renaming files in Automator
Archived from groups: alt>comp>lang>applescript, others (more info?)

I am using automator to combine 4 specific files into a PDF. Then
moving the temporary name PDF into a specific folder.

That folder contains a file named (say) a.pdf. I want to name the
temporary name PDF as a.pdf, effectively overwriting the file.

When I use the Name Single Item in Finder Item Names (Rename Finder
Items) to do that, the workflow quits complaining that a.pdf already
exists. Duh. There is no option to make it overwrite the existing file.

An option is to delete the pre-existing a.pdf before the rename, but I
am not sure Automator can do that because the file references will get
messed up.

Any ideas?

 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Patrick Stadelmann

External


Since: Nov 12, 2003
Posts: 247



(Msg. 2) Posted: Fri Jan 07, 2011 4:25 am
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
Geico Caveman wrote:

> I am using automator to combine 4 specific files into a PDF. Then
> moving the temporary name PDF into a specific folder.
>
> That folder contains a file named (say) a.pdf. I want to name the
> temporary name PDF as a.pdf, effectively overwriting the file.

Rename the file right after creating it, in the temporary directory, and
then move it using the "Replace existing files" option.

Patrick
--
Patrick Stadelmann

 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Andrew Brydon

External


Since: Apr 11, 2007
Posts: 15



(Msg. 3) Posted: Mon Jan 10, 2011 1:25 am
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 07/01/2011 08:45, Patrick Stadelmann wrote:
> In article ,
> Geico Caveman wrote:
>
>> I am using automator to combine 4 specific files into a PDF. Then
>> moving the temporary name PDF into a specific folder.
>>
>> That folder contains a file named (say) a.pdf. I want to name the
>> temporary name PDF as a.pdf, effectively overwriting the file.
>
> Rename the file right after creating it, in the temporary directory, and
> then move it using the "Replace existing files" option.

You should also be able to rename the file where it is. I do this about
once a week for dozens of files in a folder. I use the "Replace Text in
Finder Item Names" action. Particular for your usage, there's a "Change
case" in the top-left pull-down option, then you can choose "Extension
only".

--
Andrew Brydon
Life is just the beta-version of death
 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Ksaitor

External


Since: Jan 26, 2011
Posts: 4



(Msg. 4) Posted: Wed Jan 26, 2011 4:00 am
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I have a similar problem:
In several folders i have files
..../1/a.dat
..../1/a_edit.dat
..../2/.../b.dat
..../2/.../b_edit.dat
..../nn/.../.../helloworld.dat
..../nn/.../.../helloworld_edit.dat

I'm filtering only the _edit.dat files, adding them to Get Specified
Finder Items and trying to rename them, deleting the "_edit" part and
replacing originals in their according paths. But no success :(
Help, please!
 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Ksaitor

External


Since: Jan 26, 2011
Posts: 4



(Msg. 5) Posted: Wed Jan 26, 2011 6:20 am
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Why not simply delete the original files beforehand ?
>
> Patrick
> --
> Patrick Stadelmann

Because my software edits a sets of files, and creates new ones with
suffixes in the same folders. Deleting "beforehand" is not applicable
in this case.
 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Ksaitor

External


Since: Jan 26, 2011
Posts: 4



(Msg. 6) Posted: Wed Jan 26, 2011 6:21 am
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Why not simply delete the original files beforehand ?
>
> Patrick
> --
> Patrick Stadelmann

Because my software edits a sets of files, and creates new ones with
suffixes in the same folders. Deleting "beforehand" is not applicable
in this case.
 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Ksaitor

External


Since: Jan 26, 2011
Posts: 4



(Msg. 7) Posted: Wed Jan 26, 2011 9:13 am
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 26 янв, 17:08, Patrick Stadelmann
wrote:
> In article
> ,
>
>  Ksaitor wrote:
> > > Why not simply delete the original files beforehand ?
>
> > > Patrick
> > > --
> > > Patrick Stadelmann
>
> > Because my software edits a sets of files, and creates new ones with
> > suffixes in the same folders. Deleting "beforehand" is not applicable
> > in this case.
>
> By beforehand, I meant before once you have both the original and "edit"
> files, but before renaming the originals. If you get rid of the
> originals, you can rename the "edit" files in place, which is much
> simpler.
>
> Patrick
> --
> Patrick Stadelmann

:) yes... but how to automate all that??? i.e. to find all originals,
delete them, then rename edited ones, taking into account that file-
pairs are in different folders?
 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Patrick Stadelmann

External


Since: Nov 12, 2003
Posts: 247



(Msg. 8) Posted: Wed Jan 26, 2011 1:59 pm
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
Ksaitor wrote:

> I have a similar problem:
> In several folders i have files
> .../1/a.dat
> .../1/a_edit.dat
> .../2/.../b.dat
> .../2/.../b_edit.dat
> .../nn/.../.../helloworld.dat
> .../nn/.../.../helloworld_edit.dat
>
> I'm filtering only the _edit.dat files, adding them to Get Specified
> Finder Items and trying to rename them, deleting the "_edit" part and
> replacing originals in their according paths. But no success :(
> Help, please!

Why not simply delete the original files beforehand ?

Patrick
--
Patrick Stadelmann
 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Patrick Stadelmann

External


Since: Nov 12, 2003
Posts: 247



(Msg. 9) Posted: Wed Jan 26, 2011 4:08 pm
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
Ksaitor wrote:

> > Why not simply delete the original files beforehand ?
> >
> > Patrick
> > --
> > Patrick Stadelmann
>
> Because my software edits a sets of files, and creates new ones with
> suffixes in the same folders. Deleting "beforehand" is not applicable
> in this case.

By beforehand, I meant before once you have both the original and "edit"
files, but before renaming the originals. If you get rid of the
originals, you can rename the "edit" files in place, which is much
simpler.

Patrick
--
Patrick Stadelmann
 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Patrick Stadelmann

External


Since: Nov 12, 2003
Posts: 247



(Msg. 10) Posted: Wed Jan 26, 2011 8:05 pm
Post subject: Re: Renaming files in Automator [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
Ksaitor wrote:

> :) yes... but how to automate all that??? i.e. to find all originals,
> delete them,

The easiest way is with Spotlight, since built-in actions in Automator
do not allow to find files that don't contain a given string.

Go to the top folder, do Command + F, under "Search" selects your folder
(and not "This Mac") and "File Name".
Press the Alt key and click on the "..." button on the right. Click on
the "-" on the "Kind" line to remove it. Change "Any of the following
are true" to "None ..." and click on the "+" on the right. Complete the
configuration so that it is :

None of the following are true
Kind is Folder
Name contains "_edit"

You should now have all your originals files listed. If OK, selects them
and trash them.

> then rename edited ones, taking into account that file-
> pairs are in different folders?

Use Automator, "Find Finder Items" : Search <your top folder>, All of
the following are true, Name contains "_edit"

"Rename Finder Items", "Replace Text", Find : _edit, let Replace empty.

Patrick
--
Patrick Stadelmann
 >> Stay informed about: Renaming files in Automator 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> General Discussion All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]