Page 1 of 3

### Miscellaneous - Questions

Posted: 14 May 2019 05:35
EDITED Version
Hello!

#1 - Suffix for Folder from Selected file.

1. Folder Name is '#1'
2. Selected File Name is 'New Name for #1 Folder'
3. Folder name would be like this: '#1New Name for #1 Folder'

Code: Select all

    $SelectNumber1Folder = ; // '#1 Folder' don't know how to handle it that I will give it new name. msg$SelectNumber1Folder;

// this works good I copied from @highend
$copyNameofSelectedFile = gpc(gettoken(<get SelectedItemsPathNames |>, 1, "|"), "base"); msg$copyNameofSelectedFile; // gives correct name

P.S Sorry for my bad explanation at first attempt.

### Re: Miscellaneous - Questions

Posted: 14 May 2019 07:29
What (no clue what you mean)?

### Re: Miscellaneous - Questions

Posted: 14 May 2019 07:43
For pasteto to work, you have to have some files on the clipboard.
And you have give a correct path as paste target; (Why are you using pasteto "*"?)

Code: Select all

copy <get SelectedItemsPathNames |>; // or, copy <selitems |>;
pasteto "path\to\destination\folder";

### Re: Miscellaneous - Questions

Posted: 14 May 2019 14:40

@highend - I re-write my initial post, hope I explained more clearly than previous one.
@SammaySarkar - Thanks a lot for your reply, I was tried them before re-write my initial post. I get correctly msg but not able to add msg result end of the folder (suffix).

### Re: Miscellaneous - Questions

Posted: 14 May 2019 14:53
So you are in
"R:\#1"

It contains the file, which is also selected:
"R:\#1\Some file name.extension"

And now you want
"R:\#1" be renamed into "R:\#1Some File name"?

Code: Select all

renameitem($parent, , 1, <#1>);  for example: Selected Folder Name: 'Random Folder' Files name in the Folder: 'Something Else.jpg' (file extension can be anything in this case) I would like to rename files inside of the Folder like this: 'Random Folder - 1.jpg' ### Re: Miscellaneous - Questions Posted: 16 May 2019 11:00 Loop over all items either via foreach or while... Code: Select all $parent = gpc(<curitem>, "base", -2, 1);
$itemsInside = listfolder(<curitem>, , 4); while ($i++ < gettoken($itemsInside, "count", "|")) {$item = gettoken($itemsInside,$i, "|");
renameitem("$parent -$i." . gpc($item, "ext"), "<curitem>\$item");
}
end true;

$parent = gpc(<curitem>, "base", -2, 1);$i = 1;
foreach($item, listfolder(<curitem>, , 4), , "e") { renameitem("$parent - $i." . gpc($item, "ext"), "<curitem>\$item");$i++;
}


### Re: Miscellaneous - Questions

Posted: 16 May 2019 11:45
@highend - Thanks a lot, that is what I want.
And I will be able to use that script if renaming start from Created Date.

(p.s I tried to modify it by myself, failed. Scripting so hard.)

2nd Edited
Isn't that possible to start renaming from 1st Created Date?
(I am worrying that I am spending my time for nothing to searching about it.)

### Re: Miscellaneous - Questions

Posted: 20 May 2019 21:44
#3 - Rename Suffix from Clipboard.

First of all, believe me I spent a lot of time to do this simple thing but failed.
@highend did similar thing above, but I failed to customize it for my this concern.

I want to clipboard will add as Suffix currently selected item in Tree

### Re: Miscellaneous - Questions

Posted: 20 May 2019 22:27
1. No clue what you are trying to say
2. You failed, ok. Where exactly?

### Re: Miscellaneous - Questions

Posted: 20 May 2019 22:36

I selected Folder in Tree.
Folder Name: '1-'
Clipboard: '(clipboard as suffix here)'
I want Result will be like this: 1-(clipboard as suffix here)

### Re: Miscellaneous - Questions

Posted: 20 May 2019 22:40
And where exactly did you fail trying to accomplish this?

### Re: Miscellaneous - Questions

Posted: 20 May 2019 22:42
This is what I tried.

Code: Select all