Jump to content


Photo

Rename File action

rename fileaction

  • Please log in to reply
10 replies to this topic

#1 oderwat

oderwat

    Member

  • Member
  • PipPip
  • 34 posts
  • LocationGermany

Posted 03 April 2013 - 08:11 PM

Well there was a feature Request for adding "Rename File" to the internal commands on files here: http://www.alfredfor...le-action-list/

David Ferguson quickly replied with an custom workflow (with some smart Alfred magic making Alfred calling search on itself!)

But his version was a bit raw and limited to files only. So I enhanced it as follows:

1. It uses "mv" instead of cp / remove. This way it will work on folders (and bundles).
2. I made it so that the original name is the default when you rename a file.
3. I added Alleyoop update to it as I may enhance / debug in the future.

You can get my "Rename File" workflow version from here: https://github.com/o....alfredworkflow

V1.1: Visible rename confimation. Fixed renaming of files with spaces in name. CMD Return on rename now copies the resulting file path to the clipboard. Upgraded Alleyoop code too.

All my current workflows are available here: https://github.com/o...alfredworkflows

Edited by oderwat, 12 April 2013 - 04:46 PM.

  • thec13 and 300DDR like this

#2 vdesabou

vdesabou

    Advanced Member

  • Member
  • PipPipPip
  • 333 posts
  • LocationParis

Posted 05 April 2013 - 10:13 AM

Thanks, great workflow, I use it a lot!

 

I've just added on my side a Notification at the end and a Copy to clipboard with the new file name in order to quickly browse it in Alfred if I need to



#3 hzlzh

hzlzh

    Member

  • Member
  • PipPip
  • 177 posts

Posted 05 April 2013 - 01:27 PM

Great one, rename now become easy.


Share on [Alfred Workflow List](Un-offical) : www.AlfredWorkflow.comSubmit Workflows | Workflow Searcher


#4 The_Ben

The_Ben

    Member

  • Member
  • PipPip
  • 33 posts

Posted 06 April 2013 - 04:57 PM

Thanks for the workflow, this is the first one I found that actually works (for the most part, see below).

Please note that if you're trying to rename a file with more than one word, you only get the first word as the default "rename-to" filename.


I don't have much time to look at the code and try to fix it unfortunately, but I'm sure you'll push an update fixing this soon enough, shouldn't be a huge bug to fix, considering the renaming works fine, just the preview doesn't "populate" with the default filename properly.


Edited by The_Ben, 06 April 2013 - 04:59 PM.


#5 jbucchieri

jbucchieri

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 09 April 2013 - 02:56 AM

thanks for the workflow. is there anyway to make the font smaller so that the entire original filename can be displayed in the alfred window?

 

j



#6 Subject22

Subject22

    Member

  • Member
  • PipPip
  • 143 posts

Posted 09 April 2013 - 05:05 AM

thanks for the workflow. is there anyway to make the font smaller so that the entire original filename can be displayed in the alfred window?

 

You'd have to change the font size for everything. Alfred Preferences > Appearance > Theme then cmd+shift+click on the text you want to make smaller.



#7 vdesabou

vdesabou

    Advanced Member

  • Member
  • PipPipPip
  • 333 posts
  • LocationParis

Posted 10 April 2013 - 04:00 PM

Thanks for the workflow, this is the first one I found that actually works (for the most part, see below).

Please note that if you're trying to rename a file with more than one word, you only get the first word as the default "rename-to" filename.


I don't have much time to look at the code and try to fix it unfortunately, but I'm sure you'll push an update fixing this soon enough, shouldn't be a huge bug to fix, considering the renaming works fine, just the preview doesn't "populate" with the default filename properly.

 

As I have a lot of files with spaces in it, I'm proposing  a fix for this issue, see http://d.pr/f/LY6A

 

@oderwat can you validate my fix and include it in yours ?

 

Hope this helps

 

Cheers



#8 oderwat

oderwat

    Member

  • Member
  • PipPip
  • 34 posts
  • LocationGermany

Posted 12 April 2013 - 04:45 PM

Hey @vdesabou!

 

I modified "my" version of the script to handle the spaces in Names, grabbed that visible message idea and made the clipboard copying optional when you press CMD on rename (I hate to mess up my clipboard as side effect).

 

I did not add your extra script cause I like to have the things "visible" so others can check it out and use part of it.

 

Still not tested very much! I am not sure if all escaping works as expected. There may be still problems with some filenames.



#9 vdesabou

vdesabou

    Advanced Member

  • Member
  • PipPipPip
  • 333 posts
  • LocationParis

Posted 12 April 2013 - 05:35 PM

Hey @vdesabou!

 

I modified "my" version of the script to handle the spaces in Names, grabbed that visible message idea and made the clipboard copying optional when you press CMD on rename (I hate to mess up my clipboard as side effect).

 

I did not add your extra script cause I like to have the things "visible" so others can check it out and use part of it.

 

Still not tested very much! I am not sure if all escaping works as expected. There may be still problems with some filenames.

 

Yeah no worries, I forgot I added that on my side :-)

Cheers



#10 spacecadet9

spacecadet9

    Member

  • Member
  • PipPip
  • 59 posts

Posted 17 April 2013 - 02:52 PM

Hi

 

I can't seem to see this workflow working at all!

 

What is the best way I can debug it to see what's going on?

 

Thanks



#11 sudopeople

sudopeople

    Member

  • Member
  • PipPip
  • 25 posts

Posted 10 September 2014 - 11:45 PM

Awesome workflow! Thanks very much for sharing.





Also tagged with one or more of these keywords: rename, fileaction

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users