How to Copy 1 level UP & Rename in coverart & folder?

Now I have 2 button for this job done. I want to combine all the commands into 1 button.
button 1 is

@hidenosel 
Copy TO ..

This button copy the selected file 1 level UP.
button 2 is:

@firstfileonly
@disablenosel:type=*.jpg
Rename TO folder.jpg
Copy DUPLICATE AS coverart.jpg

This button Rename the Selected photo in to folder.jpg then duplicate the file in the same location and rename in to coverart.jpg

Now I want to combine them in to 1 button, How to do that?

What is selected when you run the first button? Just the coverart jpeg, or more than that?

Which part of combining everything into one command are you having trouble with?

In the very first I just Select 1 Photo.jpg file Then want to Click a button
This button will Copy the selected file 1 Level UP
Then Rename the photo in to folder.jpg then duplicate the file in the same location and rename in to coverart.jpg

You can do all of that with a couple of simple Copy commands.

Which part are you stuck on? Have you looked at the Copy command arguments?

I have tried with This Command

Copy TO ..
Go UP 
Rename TO folder.jpg
Copy DUPLICATE AS coverart.jpg

The First Line of this command Copy TO .. Works fine. That Copied The Selected Photo.jpg 1 Level UP.
The 2nd Line of This Command Go UP Works Fine.

Now I Need some Command for auto Select That Copied File This is the part Where I am Stuck
If some command Select that File Then
3r & 4th Line will do the rest of Job

The Copy command has an AS argument which you can use to specify the new name of the file.

You can copy the file to folder.jpg and then move it to coverart.jpg in two simple lines. No need for separate renames, and definitely no need to move the file display up to the parent folder.

I'm leaving the exact solution as an exercise as I think you need practise working this stuff out, and handing out complete solutions has not been helping you to learn how to solve things yourself, after such a long time and many questions.

Hi Dear Leo You did not get my need yet.

Ok in that case I use this command

Copy DUPLICATE AS coverart.jpg
Copy DUPLICATE AS folder.jpg

for the 2 file I need. no 1 a file that's name is coverart.jpg and no 2 a file that's name is folder.jpg

Now I have to cut this 2 files into 1 level UP. So now tell me how can I do it?

There's no need to use the duplicate argument. That is for copying a file to the folder it is already in.

The first line of your old command used TO .. to copy things to the parent folder. You already have all the pieces you need to solve the puzzle.

Yes I exactly Need copying a file to that folder it is already in. This is why I Need this duplicate argument.

Yes I know TO .. command to copy things to the parent folder. But the Problem is that after creating the 2 files coverart.jpg and folder.jpg theses files is deselect. But I need to keep Theses files be Selected Then TO .. command can work properly. Can I make my self clear now?

You don't need to reselect anything.

OK, I'll just do it for you:

Copy TO .. AS coverart.jpg
Copy MOVE TO .. AS folder.jpg

That is all you need. No other lines. Nothing in the answer wasn't already on the page.

Hi Leo Thanks for the code. But there is a little problem. This Code does not keep my Original file Which file I select before use this button. I need to keep my source file as it is. But This code does not keep my file as it is.

You can do it, Khalid!

Re-read Leo's code very carefully and think about the problem that you are having. Think about what each word does and does it pertain to the current problem :slight_smile:

Thank you Crash for you comments
I have solve this problem but in a different way. I Think maybe there is a easy code can do the same Thing. Here is my Code
This Code does exactly what I want, but maybe it can be simpler, but I can't.

Copy DUPLICATE AS coverart.jpg
Copy DUPLICATE AS folder.jpg 
Select NONE 
Select coverart.jpg
Select folder.jpg
Copy MOVE TO ..
Go UP 

Nicely done that you got it to work! but it could all run with 2 lines. Leo's code will work if you just remove 1 word and 1 space that is attached to the word (5 characters) :slight_smile:

Whats the difference between line 1 and line 2? Line 1 is leaving the original file in place so line 2 can run on the original file as well. What is line 2 then doing to the original file that line 1 is not?

2 Likes

Hi Dear
Crash
U are so lovely guy. Now I understand What's the difference between line 1 and line 2 :wink:
Finally I done it with this code.

Copy TO .. AS coverart.jpg
Copy TO .. AS folder.jpg
Go UP 

I need to go the parent folder so I add the GO UP command with this.

2 Likes

Most excellent, you found it! :slight_smile:

Either Leo went to sleep or he was waiting for you to figure it out on your own. I just wanted to encourage his teachings a little since it was an easy fix :slight_smile: I don't understand coding very well but this one even I could see :wink: Glad you stuck with it and figured it out.

He probably knocked himself out shaking his head in disbelief about the last question.