Multi Commander > Script

2 functions I'd like to see

(1/3) > >>

Ulfhednar:
Wondering if it is possible to add script commands for
set output file-size for the packer function - for disk spanning etc. (The existing GUI packer dialog could also benefit from an output file-size setting option)
Get string from the clipboard - I thought of a button for renaming a file with clipboard text & moving it to a target folder

Obviously if it is a lot of work then don't worry too much about it ;)

Mathias (Author):
Not sure what a "set output filesize" option for the packer function are useful for.. because none of the packers support Disk Spanning. (Yet. and kind of low prio)

Script function for "Get string from clipboard" already exists
http://multicommander.com/docs/multiscript/functions/misc#getclipboardtext

Ulfhednar:
get clipboard string - Hmm I am going blind - I looked for it & didn't find it....Sorry :-[

I would normally use 7zip for spanning - I had disk images I wanted to cut up to span DVDRs - then I thought of making a packer button to compare the functionality & didn't get too far. :)
It isn't  a necessity with things like 7zip around, but it felt strange not to see an output size field as I have got used to seeing so many fine details in your work. ;)

Ulfhednar:
I came up with this, amazingly it works but I'm wondering if it is optimal.   


--- Code: ---@var $arr = GetSourceSelectedPaths();
@var $items = arrayCount($arr);
@var $CurrentNameFullPath;
@var $OrgName;
@var $NewName= GetClipboardText();
@var $ext = PathGetFileExtPart( $arr );
@var $n = 0

// name from clipboard

for( $n = 0; $n < $items; $n++ )
{
  $CurrentNameFullPath = $arr[ $n ];
  $OrgName = PathGetNamePart( $CurrentNameFullPath );
   
  RenameFile( $CurrentNameFullPath, $NewName+$ext, );
  }
--- End code ---

Mathias (Author):

--- Quote from: Ulfhednar on February 15, 2015, 00:02:23 ---@var $ext = PathGetFileExtPart( $arr );

--- End quote ---
This is wrong. PathGetFileExtPart(..) takes a string. you send it an entire list of strings. By accident it "MIGHT" use the first string in the list.
But if you have files selected with different extension you will always set the same file extension.
You should do this inside the loop so the file get the same file extension that the file already have.

Navigation

[0] Message Index

[#] Next page

Go to full version