MultiScript - Get and Set Selection and Paths

Functions for getting focus/selected files and folder from source/target views.

GetSelectedFileNames Get an array of all currently selected files in the source panel.
GetSelectedPaths Get an array with full paths of all currently selected files in the source panel.
GetSourceSelectedFileNames Get an array with the names of selected items in the source panel.
GetTargetSelectedFileNames Get an array with the names of selected items in the target panel.
GetSourceSelectedPaths Get an array with the full paths of the selected items in the source panel.
GetTargetSelectedPaths Get an array with the full paths of the selected items in the target panel.
GetSourcePath Get the current source path.
GetTargetPath Get the current target path.
GetSourceFocusPath Get the full path of the item in focus in the source panel.
GetTargetFocusPath Get the full path of the item in focus in the target panel.
GetSourceFocusName Get the name of the item in focus in the source panel.
GetTargetFocusName Get the name of the item in focus in the target panel.
GetSourceItems Get an array with all filenames or full paths of all items in the source panel.
GetTargetItems Get an array with all filenames or full paths of all items in the target panel.
SetSourceSelected Set selection in the source panel.
SetTargetSelected Set selection in the target panel.

GetSelectedFileNames

Get the filenames of all selected files/folders in the source view.

<arr> GetSelectedFileNames();

Return value

An array of all the names of the selected files and folders in the source view.

Example

@var $arr = GetSelectedFileNames();
LogDumpArray($arr);

GetSelectedPaths

Get the complete filepaths of all selected files/folders in the source view.

<arr> GetSelectedPaths();

Return value

An array of the complete paths for all the selected files and folders in the source view.

Example

@var $arr = GetSelectedPaths();
LogDumpArray($arr);

GetSourceSelectedFileNames

Get an array of the filenames of the selected items in the source view.

<arr> GetSourceSelectedFileNames();

Return value

An array of file names (names only - not complete paths).

Example

@var $arr = GetSourceSelectedFileNames();
LogDumpArray($arr);

GetTargetSelectedFileNames

Get an array of all the filenames of the selected items in the target view.

<arr> GetTargetSelectedFileNames();

Return value

An array of file names (names only - not complete paths).

Example

@var $arr = GetTargetSelectedFileNames();
LogDumpArray($arr);

GetSourceSelectedPaths

Get an array with the full paths of all selected items in the source view.

<arr> GetSourceSelectedPaths();

Return value

An array of full paths to files or folder.s

Example

@var $arr = GetSourceSelectedPaths();
LogDumpArray($arr);

GetTargetSelectedPaths

Get an array with the full paths of all selected items in the target view.

<arr> GetTargetSelectedPaths();

Return value

An array of full paths to files or folders.

Example

@var $arr = GetTargetSelectedPaths();
LogDumpArray($arr);

GetSourcePath

Get the complete path as currently shown in the source view.

<str> GetSourcePath();

Return value

A string with the complete path shown in the source view.

Example

@var $str = GetSourcePath();
// $str == "C:\MyFolder\";

GetTargetPath

Get the complete path as currently shown in the target view.

<str> GetTargetPath();

Return value

A string with the complete path shown in the target view.

Example

@var $str = GetTargetPath();
// $str == "C:\MyFolder\";

GetSourceFocusPath

Get the full path to the item in focus in the source view.

<str> GetSourceFocusPath();

Return value

A string with the full path to the item in focus

Example

@var $str = GetSourceFocusPath();
// $str == "C:\MyFolder\MyFile.txt";

GetTargetFocusPath

Get the full path to the item in focus in the target view.

<str> GetTargetFocusPath();

Return value

A string with the full path to the item in focus

Example

@var $str = GetTargetFocusPath();
// $str == "C:\MyFolder\MyFile.txt";

GetSourceFocusName

Get the name only of the item in focus in the source view.

<str> GetSourceFocusName();

Return value

A string with the name of the item in focus

Example

@var $str = GetSourceFocusName();
// $str == "MyFile.txt";

GetTargetFocusName

Get the name only of the item in focus in the target view.

<str> GetTargetFocusName();

Return value

A string with the name of the item in focus

Example

@var $str = GetTargetFocusName();
// $str == "MyFile.txt";

GetSourceItems

Get an array with all filename or fullpath of all the items in the source panel.

<arr> GetSourceItems([<num> fullpath]);

Parameters

fullpath

Optional. If provided and set to 1, it will return full filepaths, else only filenames are returned. If not set, 0 is assumed

Return value

An array with filename or path of all the items in the panel

Example

@var $arr = GetSourceItems();
// Full paths
@var $arr = GetSourceItems(1);

GetTargetItems

Get an array with all filename or full path of all the items in the target panel.

<arr> GetTargetItems([<num> fullpath]);

Parameters

fullpath

Optional. If provided and set to 1, it will return full filepaths, else only filenames are returned. If not set, 0 is assumed.

Return value

An array with filename or path of all the items in the panel

Example

@var $arr = GetTargetItems();
// Full paths
@var $arr = GetTargetItems(1);

SetSourceSelected

Set selection in the source panel

<int> SetSourceSelected(<arr> filenames, [<int> clear]);

Parameters

filenames

An array of filenames. The filenames will be used to match against the existing file in the view. and matched files will be selected.

clear

Optional. If provided and set to 1, the selections the in source view will be cleared before new selections are added
If set to 0, the new selections will be added to existing. If not set, 1 is assumed.

Return value

Number of files selected

Example

@var $arr[] = {"file1.txt", "file2.txt"};
@var $num = SetSourceSelected( $arr , 1);

SetTargetSelected

Set selection in the target panel

<int> SeTargetSelected(<arr> filenames, [<int> clear]);

Parameters

filenames

An array with strings of filename. The filename will be used to match against the existing file in the view. and matched files will be selected

clear

Optional. If provided and set to 1, the selections in the source view will be cleared before new selections are added
If set to 0, the new selections will be added to existing. If not set, 1 is assumed.

Return value

Number of files selected

Example

@var $arr[] = {"file1.txt", "file2.txt"};
@var $num = SetTargetSelected( $arr , 1);