Jump to content


Photo

[Updated: 07/04/2014] [File Action] Copy folder/file name v 1.5 & 1.1.1

file action action copy file folder name copy name copy file name copy folder name

  • Please log in to reply
20 replies to this topic

#1 Maciej Skrzypczak

Maciej Skrzypczak

    Member

  • Member
  • PipPip
  • 32 posts

Posted 02 April 2013 - 11:50 AM

That’s my first ‘real’ workflow made to ease my everyday job workflow. Hope you will benefit from it too. ;)
 
What that file action does is to simply copy the name of selected folder(s) or file(s). Of course workflow works not only in Alfred File Viewer but everywhere you can select files using for example the Hotkey.
 
CopyName-01.png
 
Here are the download links:
 
 
Due to my ‘non-programming-language’ nature (I am graphic designer, not a programmer) I made it (with a lot of efforts) in AppleScript. I would appreciate help into make it works better and faster(?).
 
Changelog:
 
1.5:
  • completely rewritten version now uses only bash script (4 lines of code) so it's faster
  • allows for copying filename with its extension or without (in Run Script section delete "#" in text "#filename=${filename%.*}"
  • this version does not support multiple file/folder names copying. If you need such option download version 1.1.1 (download link above)
1.1.1:
  • allows for multiple file/folder names copying (only when used outside Alfred – in Finder, Forklift, etc.). Thanks for Carlos-Sz for modyfing this script!
 
1.1:
  • when copying file names, file's extension is cut off

1.0:

  • initial release
 
Known problems with Copy name v 1.1:
 
  • Extension cutting off not work with multiple selected files.

Edited by Maciej Skrzypczak, 07 April 2014 - 06:30 AM.

Hi, I'm Maciej Skrzypczak, editor at iMagazine - the one and only Polish magazine about Apple world.

@mcskrzypczakwww.imagazine.pl


#2 Carlos-Sz

Carlos-Sz

    Community Hero

  • Member
  • PipPipPip
  • 773 posts

Posted 12 April 2013 - 02:02 AM

If multiple files or folders what is the format would you like to be copied to the clipboard?

 

A plain list of names separated by comma (filename1, filename2, filename3)?

 

Can you please elaborate? :)



#3 Maciej Skrzypczak

Maciej Skrzypczak

    Member

  • Member
  • PipPip
  • 32 posts

Posted 12 April 2013 - 09:21 AM

If multiple files or folders what is the format would you like to be copied to the clipboard?

 

A plain list of names separated by comma (filename1, filename2, filename3)?

 

Can you please elaborate? :)

 

Hi Carlos,

 

Actually I do not use the option for copying multiple items - my job's workflow require copying only one item name at time. But I'd like to share with others and I understand some would like to copy multiple items.

 

Copying names now give each item name in new line, but I think your idea to make them be separated with comma could be good. :)

 

Question is, are you able to help with this? It doesn't even have to be written in AppleScript.

 

And thanks in advance. ;)


Hi, I'm Maciej Skrzypczak, editor at iMagazine - the one and only Polish magazine about Apple world.

@mcskrzypczakwww.imagazine.pl


#4 Maciej Skrzypczak

Maciej Skrzypczak

    Member

  • Member
  • PipPip
  • 32 posts

Posted 12 April 2013 - 11:17 AM

I've updated my workflow to v 1.1. More info in first post => http://www.alfredfor...me-v-11/?p=8879


Hi, I'm Maciej Skrzypczak, editor at iMagazine - the one and only Polish magazine about Apple world.

@mcskrzypczakwww.imagazine.pl


#5 Carlos-Sz

Carlos-Sz

    Community Hero

  • Member
  • PipPipPip
  • 773 posts

Posted 13 April 2013 - 02:01 PM

Hi Carlos,

 

Actually I do not use the option for copying multiple items - my job's workflow require copying only one item name at time. But I'd like to share with others and I understand some would like to copy multiple items.

 

Copying names now give each item name in new line, but I think your idea to make them be separated with comma could be good. :)

 

Question is, are you able to help with this? It doesn't even have to be written in AppleScript.

 

And thanks in advance. ;)

 

 

Hi,

 

Note that the version I have tweaked will overwrite yours: download

 

I tried to explain almost each line of the script. If you have any questions let me know. :)


Edited by Carlos-Sz, 13 April 2013 - 02:02 PM.


#6 Maciej Skrzypczak

Maciej Skrzypczak

    Member

  • Member
  • PipPip
  • 32 posts

Posted 22 April 2013 - 07:15 AM

Hi,

 

Note that the version I have tweaked will overwrite yours: download

 

I tried to explain almost each line of the script. If you have any questions let me know. :)

 

 

First of all, sorry for such late respond… To much to do, but so little time. :)
 
Carlos, your version is exactly what I was intended my workflow to do! It’s clearly commented, so I was also able to learn something new.
 
Wouldn’t you mind if I will update my first post for your link as the new version?
 
And one more time, great thanks for help! :)

Hi, I'm Maciej Skrzypczak, editor at iMagazine - the one and only Polish magazine about Apple world.

@mcskrzypczakwww.imagazine.pl


#7 Carlos-Sz

Carlos-Sz

    Community Hero

  • Member
  • PipPipPip
  • 773 posts

Posted 22 April 2013 - 03:54 PM

First of all, sorry for such late respond… To much to do, but so little time. :)
 
Carlos, your version is exactly what I was intended my workflow to do! It’s clearly commented, so I was also able to learn something new.
 
Wouldn’t you mind if I will update my first post for your link as the new version?
 
And one more time, great thanks for help! :)

 

Yes, you can update.

 

I’m glad I could help you. :)



#8 Dellu

Dellu

    Newbie

  • Member
  • Pip
  • 14 posts

Posted 06 April 2014 - 10:25 PM

Yes, you can update.

 

I’m glad I could help you. :)

 I am constantly using this workflow as File action and I love it.   But, for some reason, the hotkey is not working for me. Did I missed sth? What I am doing  is
1. search a file in Afred

2. select the file and inside Alfred itself and

3. hit the hotkey (CTR+Shit+CMD, in my case) without leaving Afred. 

But, the file name is not being copied. 



#9 Carlos-Sz

Carlos-Sz

    Community Hero

  • Member
  • PipPipPip
  • 773 posts

Posted 06 April 2014 - 10:50 PM

 I am constantly using this workflow as File action and I love it.   But, for some reason, the hotkey is not working for me. Did I missed sth? What I am doing  is
1. search a file in Afred

2. select the file and inside Alfred itself and

3. hit the hotkey (CTR+Shit+CMD, in my case) without leaving Afred. 

But, the file name is not being copied. 

 

The hotkey was made to be used outside Alfred:

 

1. Select file(s) in Finder

2. Hit the hotkey

 

Now you should see a notification and the filenames will be ready to be pasted.



#10 Dellu

Dellu

    Newbie

  • Member
  • Pip
  • 14 posts

Posted 07 April 2014 - 01:52 AM

The hotkey was made to be used outside Alfred:

 

1. Select file(s) in Finder

2. Hit the hotkey

 

Now you should see a notification and the filenames will be ready to be pasted.

Well, that misses the whole point of simplicity and speed. isn't there a way to hit the hotkeys without leaving Alfred?

thanks for the fast reply, by the way. 



#11 Carlos-Sz

Carlos-Sz

    Community Hero

  • Member
  • PipPipPip
  • 773 posts

Posted 07 April 2014 - 05:25 AM

If you are in Alfred I'm afraid you have to use file action.

However, I think you have to suggest such feature: hotkey+Alfred selection like hotkey+OSX selection that we already have.

Well, that misses the whole point of simplicity and speed. isn't there a way to hit the hotkeys without leaving Alfred?
thanks for the fast reply, by the way.



#12 Maciej Skrzypczak

Maciej Skrzypczak

    Member

  • Member
  • PipPip
  • 32 posts

Posted 07 April 2014 - 06:03 AM

I have updated my workflow to versions 1.5 and 1.1.1 (kudos for Carlos Sz). Read desription in the first post → click.


Hi, I'm Maciej Skrzypczak, editor at iMagazine - the one and only Polish magazine about Apple world.

@mcskrzypczakwww.imagazine.pl


#13 Maciej Skrzypczak

Maciej Skrzypczak

    Member

  • Member
  • PipPip
  • 32 posts

Posted 07 April 2014 - 06:13 AM

 I am constantly using this workflow as File action and I love it.   But, for some reason, the hotkey is not working for me. Did I missed sth? What I am doing  is
1. search a file in Afred

2. select the file and inside Alfred itself and

3. hit the hotkey (CTR+Shit+CMD, in my case) without leaving Afred. 

But, the file name is not being copied. 

 

Hi Dellu. First of all I am glad you like my workflow, I am too using it commonly. As of your problem – the workflow is working with specified by user shortcuts inside Alfred. Don't know why it does not in your case. Am I understand it right that you set:

Ctrl+Shift+Cmd+,

 If so, I have checked it and it works properly.

 

The hotkey was made to be used outside Alfred:

 

1. Select file(s) in Finder

2. Hit the hotkey

 

Now you should see a notification and the filenames will be ready to be pasted.

 

Unfurtunatelly (but happily) what you are writing is slightly wrong Carlos. ;) Workflow shortcut will work not only outside Alfred (in Finder, PathFinder, Forklift, open file dialogue windows, etc.) but also inside Alfred window which is when normally searching files (using "spacebar+search phrase" by default) or in Alfred-File-Browser. I am using this ability very often so I am 100% sure about this. :)


Edited by Maciej Skrzypczak, 07 April 2014 - 06:16 AM.

  • Carlos-Sz likes this

Hi, I'm Maciej Skrzypczak, editor at iMagazine - the one and only Polish magazine about Apple world.

@mcskrzypczakwww.imagazine.pl


#14 Dellu

Dellu

    Newbie

  • Member
  • Pip
  • 14 posts

Posted 07 April 2014 - 02:13 PM

Hi Dellu. First of all I am glad you like my workflow, I am too using it commonly. As of your problem – the workflow is working with specified by user shortcuts inside Alfred. Don't know why it does not in your case. Am I understand it right that you set:

Ctrl+Shift+Cmd+,

 If so, I have checked it and it works properly.

 

 

Unfurtunatelly (but happily) what you are writing is slightly wrong Carlos. ;) Workflow shortcut will work not only outside Alfred (in Finder, PathFinder, Forklift, open file dialogue windows, etc.) but also inside Alfred window which is when normally searching files (using "spacebar+search phrase" by default) or in Alfred-File-Browser. I am using this ability very often so I am 100% sure about this. :)

Thank you Maciej. It is working now. the problem was how I make the selection in Afred.

What have you changed in the new version? the earlier version (1.1) was hiding the extension; sth that I like. the new version seems to include the file extension. I will stick with the older version for now. I am using it to develop a rather more advanced workflow using Keyboard Maestro for citing references inside a MultimMarkdown document.  
Great workflow,

thank you guys

Cheers



#15 Maciej Skrzypczak

Maciej Skrzypczak

    Member

  • Member
  • PipPip
  • 32 posts

Posted 07 April 2014 - 03:02 PM

Thank you Maciej. It is working now. the problem was how I make the selection in Afred.

What have you changed in the new version? the earlier version (1.1) was hiding the extension; sth that I like. the new version seems to include the file extension. I will stick with the older version for now. I am using it to develop a rather more advanced workflow using Keyboard Maestro for citing references inside a MultimMarkdown document.  
Great workflow,

thank you guys

Cheers

Everything is described in the first post. ;) To get rid of extension you need to edit workflow – in Run Script delete „#” in

#filename=${filename%.*}

Hi, I'm Maciej Skrzypczak, editor at iMagazine - the one and only Polish magazine about Apple world.

@mcskrzypczakwww.imagazine.pl


#16 Carlos-Sz

Carlos-Sz

    Community Hero

  • Member
  • PipPipPip
  • 773 posts

Posted 07 April 2014 - 04:03 PM

...

 

Unfurtunatelly (but happily) what you are writing is slightly wrong Carlos. ;) Workflow shortcut will work not only outside Alfred (in Finder, PathFinder, Forklift, open file dialogue windows, etc.) but also inside Alfred window which is when normally searching files (using "spacebar+search phrase" by default) or in Alfred-File-Browser. I am using this ability very often so I am 100% sure about this. :)

 

I got it working. I was selecting a file in Alfred (which leads to file action) and not only highlighting it. I was not aware that it was possible anyway. :)



#17 stevebabo

stevebabo

    Newbie

  • New Member
  • Pip
  • 2 posts

Posted 05 August 2014 - 06:32 PM

Hi,

 

I'm trying to use this workflow, and I think I have a conceptual gap.

 

-select file in finder

-use hotkey alfred should open up where i can type the folder to move file to

 

Is this how it is suppose  to work?



#18 Maciej Skrzypczak

Maciej Skrzypczak

    Member

  • Member
  • PipPip
  • 32 posts

Posted 05 August 2014 - 07:27 PM

Hi,

 

I'm trying to use this workflow, and I think I have a conceptual gap.

 

-select file in finder

-use hotkey alfred should open up where i can type the folder to move file to

 

Is this how it is suppose  to work?

 

Hi!

 

The purpose of this workflow is to just copy the name of selected file or folder. Its name is stored in system clipboard so you can paste it anywhere you want.

 

What you write can be achieved by default Alfred action. You can find and set it keyboard shortcut in Features → File Search → Actions → File Selection. Then, by selecting file/folder you can make some actions over them.


Hi, I'm Maciej Skrzypczak, editor at iMagazine - the one and only Polish magazine about Apple world.

@mcskrzypczakwww.imagazine.pl


#19 stevebabo

stevebabo

    Newbie

  • New Member
  • Pip
  • 2 posts

Posted 07 August 2014 - 03:48 PM

Hi!

 

The purpose of this workflow is to just copy the name of selected file or folder. Its name is stored in system clipboard so you can paste it anywhere you want.

 

What you write can be achieved by default Alfred action. You can find and set it keyboard shortcut in Features → File Search → Actions → File Selection. Then, by selecting file/folder you can make some actions over them.

Thanks!



#20 politicus

politicus

    Advanced Member

  • Member
  • PipPipPip
  • 272 posts

Posted 18 August 2014 - 07:06 AM

Great workflow. 

Thanks for sharing!





Also tagged with one or more of these keywords: file action, action, copy, file, folder, name, copy name, copy file name, copy folder name

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users