Nilesoft Shell Pro GitHub

SEL

Has many functions to handle selected file system objects.


sel

Returns all selected items with double quotation mark and custom separator.

Syntax

sel(quote=false, separator=' ')

Parameters

quote
Sets if the return value shall be quoted.
separator
Separator to join the different items from the selection.

Example

sel
sel(true)
sel(true, "\n")
sel.path

Returns the path of the selected item..

sel.path.name

Returns the name and extension of the selected item, the same as sel.name.

sel.path.length

Returns the number of characters in the path of the selected item.

sel.path.title

Returns the name without the extension of the selected item, the same as sel.title.

sel.path.quote

Returns the path of the selected item. with double quotation mark.

sel.short

Returns the short path of the selected item.

sel.short.length

Returns the number of characters in the short path of the selected item.

sel.raw

Returns the path of the selected item in raw format.

sel.raw.length

Returns the number of characters in the raw path of the selected item.

sel.root

Returns the root directory from the path of the selected items.

sel.name

Returns the name and extension of the selected item.

sel.name.length

Returns the number of characters in the name of the selected item.

sel.title

Returns the name without extension of the selected item.

sel.title.length

Returns the number of characters in the name without extension of the selected item.

sel.parent

Returns the directory path for the selected item.

sel.parent.quote

Returns the directory path for the selected item with quotation mark.

sel.parent.raw

Returns the directory path for the selected item in raw format.

sel.parent.name

Returns the name of the parent of the selected item.

sel.parent.length

Returns the number of characters in the parent path of the selected item.

sel.count

Returns count selected items.

sel.back

Returns whether the selection is in the background.

sel.curdir or sel.workdir

Returns the path of current working directory.

sel.file

Returns the path for the selected item. If it is a file

sel.file.name

Returns the name for the selected item. If it is a file.

sel.file.name.length

Returns the number of characters in the name of the selected item. If it is a file.

sel.file.ext

Returns the extension for the selected item. If it is a file.

sel.file.title

Returns the name without an extension for the selected item. If it is a file.

sel.file.quote

Returns the path for the selected item with quotation mark. If it is a file.

sel.directory

Returns the path for the selected item. If it is a directory.

sel.directory.name

Returns the name for the selected item. If it is a directory.

sel.directory.length

Returns the number of characters in the path of the selected item. If it is a directory.

sel.directory.quote

Returns the path for the selected item with quotation mark. If it is a directory.

sel.get

Returns the path of the selected item by referring to the index number.

Syntax

sel.get(index=0)
sel.path.raw

Returns the raw path of the selected item by referring to the index number.

Syntax

sel.path.raw(index=0)
sel.length

Returns the number of characters in the path of the selected item by referring to the index number.

Syntax

sel.length(index=0)
sel.readonly

Returns whether the selected item by referring to the index number is read-only.

Syntax

sel.readonly(index=0)
sel.hidden

Returns whether the selected item by referring to the index number is hidden.

Syntax

sel.hidden(index=0)
sel.meta

Gets meta data by property key.

Syntax

sel.meta("System.Size"))
sel.lnk

Return the target file/dir path from the selected shortcut

Syntax

sel.lnk
sel.lnk.type

Return type the shortcut

Syntax

sel.lnk.type
sel.lnk.dir

Return a dir path from the shortcut

Syntax

sel.lnk.dir
sel.lnk.icon

Return a icon path and index from the shortcut

Syntax

sel.lnk.icon
sel.lnk.args

Returns the arguments of the selected shortcut, or nothing when it has none.

Syntax

sel.lnk.args
sel.lnk.raw

Returns the target of the selected shortcut followed by its arguments, as one command line. The target is put in quotes when it has spaces.

Syntax

sel.lnk.raw

Example

sel.lnk.raw
// result:
// "C:\Program Files\App\app.exe" --profile work
sel.item

Returns the path of the current item: the one a command for several selected items is running for, or the item at the index in sel.item[index]. sel.item.len is the length of that path.

Syntax

sel.item
sel.item.len
sel.drop

In the menu that shows when you drag files with the right mouse button and let go, returns the folder they are dropped into: the folder under the pointer, or else the folder the window shows. In any other menu it is empty.

It works when you drop into the file list of a File Explorer window or on the desktop. It is empty when you drop on the navigation pane, into another program's window, or into a place that isn't a folder on disk.

Syntax

sel.drop

Example

item(title='Open @sel.drop' where=len(sel.drop) > 0 cmd=sel.drop)
item(title='Terminal in the drop folder' where=len(sel.drop) > 0 cmd='wt.exe' args='-d "@sel.drop"')