From b22ebd2cf8171144c7f927bf048f98d32ce2686b Mon Sep 17 00:00:00 2001
From: Mahmoud Gomaa This page contains some examples of what Shell can do. interprets color constants as hexadecimal if they are preceded by Comments can be used to explain Shell code, and to make it more readable. It can also be used to prevent execution Shell code. Comments can be singled-lined or multi-lined.
+ Single-line comments start with two forward slashes ( This example uses a single-line comment before a line of code: This example uses a single-line comment at the end of a line of code:
+ Multi-line comments start with
+ Single or multi-line comments? The identifier have unique titles described by fully qualified names that indicate a logical hierarchy. There is a hierarchy of keywords in that some keywords are always followed by others. Shell provides a variety of statements and expressions. Most of these will be familiar to developers who have programmed in C, C++, C#. Expressions gives you all the power of Shell, but is using a simplified syntax that's easier to learn if you're a beginner, and makes you more productive if you're an expert. To use expressions, you write them by using proper syntax. Syntax is the set of rules by which the words and symbols in an expression are correctly combined. Initially, expressions in Shell are a little bit hard to read. But with a good understanding of expression syntax and a little practice, it becomes much easier. There are two types of numbers. Integer and floating point. An integer is a numeric literal(associated with numbers) without any fractional or exponential part. There are two types of integer literals: 1. Decimal-literal(base 10): 2. Hexadecimal-literal(base 16): Floating-point literals specify values that must have a fractional part. These values contain decimal points (.) An operator is a symbol that tells to perform specific mathematical or logical manipulations. Shell is rich in built-in operators and provide the following types of operators This chapter will examine the arithmetic, relational, logical, bitwise, assignment and other operators one by one. The five arithmetical operations supported Two expressions can be compared using relational and equality operators. For example, to know if two values are equal or if one is greater than the other. The result of such an operation is either true or false (i.e., a Boolean value). The relational operators are: The operator The logical operators The conditional operator evaluates an expression, returning one value if that expression evaluates to true, and a different one if the expression evaluates as false. Its syntax is: If condition is true, the entire expression evaluates to result1, and otherwise to result2. Bitwise operators modify variables considering the bit patterns that represent the values they store. A single expression may have multiple operators. For example: the above expression always assigns 6 to variable x, because the From greatest to smallest priority, Operators are evaluated in the following order:
+ When an expression has two operators with the same precedence level, grouping determines which one is evaluated first: either left-to-right or right-to-left. string is zero or more characters written inside single or double quotes. You can use quotes inside a string, as long as they don't match the quotes surrounding the string: single quotes allow you to use the syntax of expressions within them. double quotes allow you to use the Escape Character inside them only. The complete set of escape sequences is as follows: The namespace of the application contains file paths, version and some details.
+ Copy Path example
+
+
+
\ No newline at end of file
diff --git a/docs/examples/favorites.html b/docs/examples/favorites.html
new file mode 100644
index 0000000..bad755d
--- /dev/null
+++ b/docs/examples/favorites.html
@@ -0,0 +1,37 @@
+shell
+{
+ dynamic
+ {
+ // type can set with '~taskbar' equals all file types except taskbar.
+ menu(type='file|dir|back|root|namespace' mode=multiple title='copy to clipboard' image=#ff00ff)
+ {
+ // Appears only when multiple selections.
+ item(vis=@(sel.count > 1) title='Copy path (@sel.count) items selected'
+ cmd=@sys.copy(sel(false, "\n")))
+
+ item(mode=single title=@sel.path
+ cmd=@sys.copy(sel.path))
+
+ item(mode=single type='file|dir|back.dir'
+ vis=@sel.short.len!=sel.path.len title=@sel.short
+ cmd=@sys.copy(sel.short))
+ separator
+ item(mode=single vis=@(sel.parent.len>3) title=@sel.parent
+ cmd=@sys.copy(sel.parent))
+ separator
+ item(mode=single type='file|dir|back.dir' title=@sel.file.name
+ cmd=@sys.copy(sel.file.name))
+
+ item(mode=single type='file' title=@sel.file.title
+ cmd=@sys.copy(sel.file.title))
+
+ item(mode=single type='file' title=@sel.file.ext
+ cmd=@sys.copy(sel.file.ext))
+ }
+ }
+}Favorite applications and directories example
+
+shell
+{
+ dynamic
+ {
+ menu(type='desktop|taskbar' title='Favorites' image=#00ff00)
+ {
+ menu(title='Applications' image=#ff0000)
+ {
+ item(title='Command prompt' image cmd='cmd.exe')
+ item(title='PowerShell' image cmd='powershell.exe')
+ item(title='Registry editor' image cmd='regedit.exe')
+ separator
+ item(title='Paint' image cmd='mspaint.exe')
+ item(title='Notepad' image cmd='notepad.exe')
+ }
+ separator
+ menu(title='Directories' image=#0000ff)
+ {
+ item(title='Downloads' cmd=@user.downloads)
+ item(title='Pictures' cmd=@user.pictures)
+ item(title='Home' cmd=@user.directory)
+ separator
+ item(title='Windows' cmd=@sys.directory)
+ item(title='Program files' cmd=@sys.prog)
+ }
+ }
+ }
+}
+
+
+
+
+Goto example
+
+
+shell
+{
+ dynamic
+ {
+ menu(mode=multiple title='goto' separator=after image=0xed25)
+ {
+ item(title='Windows' image-inherit cmd=@sys.dir)
+ item(title='System' image-inherit cmd=@sys.bin)
+ item(title='Program Files' image-inherit cmd=@sys.prog)
+ item(title='Program Files x86' image-inherit cmd=@sys.prog32)
+ item(title='ProgramData' image-inherit cmd=@sys.programdata)
+ item(title='Applications' image-inherit cmd='shell:appsfolder')
+ item(title='Users' image-inherit cmd=@sys.users)
+ item(title='Control Panel' image=0xe115 cmd='shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}')
+ item(title='Control Panel (All Tasks)' image=0xe115 cmd='shell:::{ED7BA470-8E54-465E-825C-99712043E01C}')
+ item(title='run' cmd='shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}')
+ separator
+ item(title='@user.name@@@sys.name' vis=disable)
+ item(title='Desktop' image-inherit cmd=@user.desktop)
+ item(title='Downloads' image-inherit cmd=@user.downloads)
+ item(title='Pictures' image-inherit cmd=@user.pictures)
+ item(title='Documents' image-inherit cmd=@user.documents)
+ item(title='Startmenu' image-inherit cmd=@user.startmenu)
+ item(title='Profile' image-inherit cmd=@user.dir)
+ item(title='AppData' image-inherit cmd=@user.appdata)
+ item(title='Temp' image-inherit cmd=@user.temp)
+ menu(title='settings' separator=before image=0xe115)
+ {
+ // https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app
+ item(title='systeminfo' image=0xe946 cmd-line='/K systeminfo')
+ item(title='search' cmd='search-ms:' image=0xe721)
+ item(title='settings' image-inherit cmd='ms-settings:')
+ item(title='about' image=0xe946 cmd='ms-settings:about')
+ item(title='usb' image=0xe88e cmd='ms-settings:usb')
+ item(title='network-status' image=0xec27 cmd='ms-settings:network-status')
+ item(title='network-ethernet' image=0xe839 cmd='ms-settings:network-ethernet')
+ item(title='personalization-background' image=0xeb9f cmd='ms-settings:personalization-background')
+ item(title='personalization-colors' image=0xe790 cmd='ms-settings:colors')
+ item(title='lockscreen' image=0xee3f cmd='ms-settings:lockscreen')
+ item(title='personalization-start' image=0xeca5 cmd='ms-settings:personalization-start')
+ item(title='appsfeatures' image=0xe179 cmd='ms-settings:appsfeatures')
+ item(title='optionalfeatures' image=0xe179 cmd='ms-settings:optionalfeatures')
+ item(title='defaultapps' image=0xe17d cmd='ms-settings:defaultapps')
+ item(title='yourinfo' image=0xe136 cmd='ms-settings:yourinfo')
+ item(title='windowsupdate' image=0xe895 cmd='ms-settings:windowsupdate')
+ item(title='windowsdefender' image=0xe83d cmd='ms-settings:windowsdefender')
+ item(title='network connections' image-inherit cmd='shell:::{7007ACC7-3202-11D1-AAD2-00805FC1270E}')
+ }
+ }
+ }
+}
+
+Examples
+Taskbar example
+
\ No newline at end of file
diff --git a/docs/expressions/color.html b/docs/expressions/color.html
new file mode 100644
index 0000000..f5acc58
--- /dev/null
+++ b/docs/expressions/color.html
@@ -0,0 +1,4 @@
+shell
+{
+ var
+ {
+ hello_world = 'Hello World!'
+ }
+
+ dynamic
+ {
+ item(title=@hello_world cmd=@msgbox(hello_world))
+ separator
+ item(title='Command prompt' cmd='cmd.exe' args='/k echo @hello_world')
+ separator
+ menu(title='Sub menu')
+ {
+ item(title='Open Paint' cmd='paint.exe' arg=@sel.path)
+ separator
+ item(title='Open Notepad' cmd='notepad.exe' arg='"@sel.path"')
+ }
+ }
+}Color literal
+
+Hexadecimal Colors
+# and hexadecimal color is specified with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color. All values must be between 00 and FF.
For example, the #0000FF value is rendered as blue, because the blue component is set to its highest value (FF) and the others are set to 00.
There are 140 color names are predefined under the color scope.Comments
+Single-line Comments
+ //).
+ Any text between // and the end of the line is ignored (will not be executed).
+
+
+ shell
+{
+ dynamic
+ {
+ // This is a comment
+ item(title='Hello World!')
+
+ //item(title='Hello World!')
+ }
+}
+shell
+{
+ dynamic
+ {
+ item(title='Hello World!') // This is a comment
+ }
+}
+Multi-line Comments
+ /* and ends with */.
+ Any text between /* and */ will be ignored.
+
+ shell
+{
+ dynamic
+ {
+ item(title='Hello,/* multiple-lines comment inside */ world')
+
+ /*
+ item(title='test item 1')
+ item(title='test item 2')
+ */
+ }
+
+}
+ It is up to you which you want to use. Normally, we use // for short comments, and /* */ for longer.
+ Identifier
+
+
The identifier that has no parameters. Parentheses are added when necessary to separate:
diff --git a/docs/expressions/index.html b/docs/expressions/index.html
new file mode 100644
index 0000000..665b81b
--- /dev/null
+++ b/docs/expressions/index.html
@@ -0,0 +1,12 @@
+sel.path
sel.path().extExpressions
+
+
+
+
diff --git a/docs/expressions/numeric.html b/docs/expressions/numeric.html
new file mode 100644
index 0000000..a0a03a3
--- /dev/null
+++ b/docs/expressions/numeric.html
@@ -0,0 +1,21 @@
+Numeric literals
+
+Integer literals
+
+
+
A non-zero decimal digit followed by zero or more decimal digits(0, 1, 2, 3, 4, 5, 6, 7, 8, 9).
+Decimal: 0, -9, 22 etc
0x followed by one or more hexadecimal digits(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f).
+Hexadecimal: 0x7f, 0x2a, 0x521 etcFloating-point iterals
+
+
+
+
diff --git a/docs/expressions/operators.html b/docs/expressions/operators.html
new file mode 100644
index 0000000..9355619
--- /dev/null
+++ b/docs/expressions/operators.html
@@ -0,0 +1,187 @@
+-2.0
0.0000234Operators
+
+Arithmetic Operators
+
+
+
+
+
+ Operator
+ Description
+
+
+ +
+ Addition
+
+
+ -
+ Subtraction
+
+
+ *
+ Multiplication
+
+
+ /
+ Division
+
+
+
+%
+ Modulo
+
+Relational and comparison operators
+
+
+
+
+
+ operator description
+
+
+ == Equal to
+
+
+ != Not equal to
+
+
+ < Less than
+
+
+ > Greater than
+
+
+ <= Less than or equal to
+
+
+
+>= Greater than or equal to
+
+Logical Operators (!, ||, &&)
+! is operator for the Boolean operation NOT. It has only one operand, to its right, and inverts it, producing false if its operand is true, and true if its operand is false. Basically, it returns the opposite Boolean value of evaluating its operand. For example:&& and || are used when evaluating two expressions to obtain a single relational result. The operator && corresponds to the Boolean logical operation AND, which yields true if both its operands are true, and false otherwise. The following panel shows the result of operator && evaluating the expression a && b:
+
+
+
+
+ operator
+ description
+
+
+ &&
+ Called Logical AND operator. If both the operands are non-zero, then condition becomes true.
+
+
+ ||
+ Called Logical OR Operator. If any of the two operands is non-zero, then condition becomes true.
+
+
+
+!
+
+ Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true, then Logical NOT operator will make false.
+
+
+ !(5 == 5) // evaluates to false because the expression at its right (5 == 5) is true
+!(6 <= 4) // evaluates to true because (6 <= 4) would be false
+!true // evaluates to false
+!false // evaluates to true
+Conditional ternary operator
+
+condition ? result1 : result2
+
+7==5 ? 4 : 3 // evaluates to 3, since 7 is not equal to 5.
+7==5+2 ? 4 : 3 // evaluates to 4, since 7 is equal to 5+2.
+5>3 ? a : b // evaluates to the value of a, since 5 is greater than 3.
+a>b ? a : b // evaluates to whichever is greater, a or b.Bitwise Operators
+
+
+
+
+
+ Operator
+ Description
+
+
+ &
+ Bitwise AND
+
+
+ |
+ Bitwise inclusive OR
+
+
+ ^
+ Bitwise exclusive OR
+
+
+ ~
+ Unary complement (bit inversion)
+
+
+ <<
+ Shift bits left
+
+
+
+>>
+ Shift bits right
+ Precedence of operators
+
+ x = 5 + 7 % 2% operator has a higher precedence than the + operator, and is always evaluated before. Parts of the expressions can be enclosed in parenthesis to override this precedence order, or to make explicitly clear the intended effect. Notice the difference:
+x = 5 + (7 % 2) // x = 6 (same as without parenthesis)
+x = (5 + 7) % 2 // x = 0
+
+
+
+
+ Level
+ Precedence group
+ Operator
+ Description
+ Grouping
+
+
+ 1
+ Postfix (unary)
+
+ ++ --postfix increment / decrement
+ Left-to-right
+
+ ()functional forms
+ []subscript
+ .member access
+
+ 2 Prefix (unary) ++ --prefix increment / decrement Right-to-left
+ ~ !bitwise NOT / logical NOT
+ + -unary prefix
+ 4 Arithmetic: scaling * / %multiply, divide, modulo Left-to-right
+ 5 Arithmetic: addition + -addition, subtraction Left-to-right
+ 6 Bitwise shift << >>shift left, shift right Left-to-right
+ 7 Relational < > <= >=comparison operators Left-to-right
+ 8 Equality == !=equality / inequality Left-to-right
+ 9 And &bitwise AND Left-to-right
+ 10 Exclusive or ^bitwise XOR Left-to-right
+ 11 Inclusive or |bitwise OR Left-to-right
+ 12 Conjunction &&logical AND Left-to-right
+ 13 Disjunction ||logical OR Left-to-right
+ 15 Assignment-level expressions =assignment Right-to-left
+ ?:conditional operator
+
+16 Sequencing ,comma separator Left-to-right
+ Enclosing all sub-statements in parentheses (even those unnecessary because of their precedence) improves code readability.
+String literal
+
+
+var
+{
+ var1 = "It's alright"
+ var2 = "He is called 'Johnny'"
+ var3 = 'He is called "Johnny"'
+}
+Single quotes
+
+
The @ sign must be placed before the expressions.
+dynamic
+{
+ item(title = 'windows dir path: @sys.dir')
+}
+Double quotes
+
+
The backslash (\) escape character turns special characters into characters.
The sequence \" inserts a double quote in a string:
+var
+{
+ var1 = "hello\"world"
+ // result: hello"world
+}
+
+
+
diff --git a/docs/functions/app.html b/docs/functions/app.html
new file mode 100644
index 0000000..9cde79e
--- /dev/null
+++ b/docs/functions/app.html
@@ -0,0 +1,54 @@
+
+ \' Single quote
+ \" Double quote
+ \\ Backslash
+ \0 Null
+ \a Alert
+ \b Backspace
+ \f Form Feed
+ \n New Line
+ \r Carriage Return
+ \t Horizontal Tab
+ \v Vertical Tab
+ \uxxxx Unicode escape sequence (UTF-16) \uHHHH (range: 0000 - FFFF)
+ \xnnnn Unicode escape sequence for character with hex value nnnn (variable length version of \uxxxx)
+
+\Uxxxxxxxx Unicode escape sequence (UTF-32) \U00HHHHHH (range: 000000 - 10FFFF) APP
+
+
+app.directory (app.dir)
+ Returns the path of Shell directory.
+
+
+
+
+
+
+
+
+
+
Color namespace contains predefined colors
++color.default +color.accent +color.aliceblue +color.antiquewhite +color.aqua +color.aquamarine +color.azure +color.beige +color.bisque +color.black +color.blanchedalmond +color.blue +color.blueviolet +color.brown +color.burlywood +color.cadetblue +color.chartreuse +color.chocolate +color.coral +color.cornflowerblue +color.cornsilk +color.crimson +color.cyan +color.darkblue +color.darkcyan +color.darkgoldenrod +color.darkgray +color.darkgreen +color.darkkhaki +color.darkmagenta +color.darkolivegreen +color.darkorange +color.darkorchid +color.darkred +color.darksalmon +color.darkseagreen +color.darkslateblue +color.darkslategray +color.darkturquoise +color.darkviolet +color.deeppink +color.deepskyblue +color.dimgray +color.dodgerblue +color.firebrick +color.floralwhite +color.forestgreen +color.fuchsia +color.gainsboro +color.ghostwhite +color.gold +color.goldenrod +color.gray +color.green +color.greenyellow +color.honeydew +color.hotpink +color.indianred +color.indigo +color.ivory +color.khaki +color.lavender +color.lavenderblush +color.lawngreen +color.lemonchiffon +color.lightblue +color.lightcoral +color.lightcyan +color.lightgoldenrodyellow +color.lightgray +color.lightgreen +color.lightpink +color.lightsalmon +color.lightseagreen +color.lightskyblue +color.lightslategray +color.lightsteelblue +color.lightyellow +color.lime +color.limegreen +color.linen +color.magenta +color.maroon +color.mediumaquamarine +color.mediumblue +color.mediumorchid +color.mediumpurple +color.mediumseagreen +color.mediumslateblue +color.mediumspringgreen +color.mediumturquoise +color.mediumvioletred +color.midnightblue +color.mintcream +color.mistyrose +color.moccasin +color.navajowhite +color.navy +color.oldlace +color.olive +color.olivedrab +color.orange +color.orangered +color.orchid +color.palegoldenrod +color.palegreen +color.paleturquoise +color.palevioletred +color.papayawhip +color.peachpuff +color.peru +color.pink +color.plum +color.powderblue +color.purple +color.red +color.rosybrown +color.royalblue +color.saddlebrown +color.salmon +color.sandybrown +color.seagreen +color.seashell +color.sienna +color.silver +color.skyblue +color.slateblue +color.slategray +color.snow +color.springgreen +color.steelblue +color.tan +color.teal +color.thistle +color.tomato +color.transparent +color.turquoise +color.violet +color.wheat +color.white +color.whitesmoke +color.yellow +color.yellowgreen +\ No newline at end of file diff --git a/docs/functions/image.html b/docs/functions/image.html new file mode 100644 index 0000000..c316415 --- /dev/null +++ b/docs/functions/image.html @@ -0,0 +1,33 @@ +
The image namespace contains functions that return an icon and are only assigned to the image property
Return font icon with color and size option.
+Syntax
+image.glyph(0xE00B)image.glyph("\uE00B")image.glyph("\xE00B")image.glyph(0xE00B, #0000ff)image.glyph(0xE00B, #0000ff, 10)image.glyph(0xE00B, #0000ff, 12, "Segoe MDL2 Assets")Returns an icon through a path or through resources.
+Syntax
+image.icon(path)image.icon(path, index)image.icon(path, -id)image(path)image(path, index)image(path, -id)Returns a colored rectangle icon of an optional size.
+Syntax
+image.rect(#0000ff)image.rect(#0000ff, 10)The functions and variables have unique titles described by fully qualified names that indicate a logical hierarchy.
+Shell has a number of functions and variables built into it that are always available. They are listed here in alphabetical order.
+Conditionally executes another statement.
+Syntax
+if(condition-expression)if(condition-expression, true-expression)if(condition-expression, true-expression, false-expression)
+Returns a null value.
+Syntax
+null(expression)Returns text with a double quotation mark.
+Syntax
+quote(expression)
+Returns the value of the numeric parameter to a character.
+Syntax
+char(numeric-expression)
+Returns the value of the passed variable
+Syntax
+var(expression)
+Converting the value of the passed numeric expression to hexadecimal string.
+Syntax
+tohex(numeric-expression)
+Returns true if the parameters passed are equal.
Syntax
+equal(expression-1, expression-2)
+Returns true if the parameters passed are not equal.
Syntax
+not(expression-1, expression-2)
+Returns true if the first parameter is greater than the second parameter.
Syntax
+greater(expression-1, expression-2)
+Returns true if the first parameter is less than the second parameter.
Syntax
+less(expression-1, expression-2)
+bitwise left shift.
+Syntax
+shl(shift-expression, additive-expression)
+bitwise right shift.
+Syntax
+shr(shift-expression, additive-expression)
+The flags that specify how an application is to be displayed when it is opened.
+cmd.hidden
+cmd.show
+cmd.visible
+cmd.normal
+cmd.maximized
+cmd.minimized
+Syntax
+mode.none
+mode.single
+mode.multiple
+mode.multiunique
+mode.multisingle
+mode.multi
+
+Syntax
+type.desktop
+type.directory(dir)
+type.drive
+type.dvd
+type.file
+type.fixed
+type.namespace
+type.remote
+type.unknown
+type.usb
+type.vhd
+null
+bool
+true
+false
+auto
+none
+default
+
+
+
+
diff --git a/docs/functions/io.html b/docs/functions/io.html
new file mode 100644
index 0000000..93072f6
--- /dev/null
+++ b/docs/functions/io.html
@@ -0,0 +1,130 @@
+Syntax
+io.attribute.archive
+io.attribute.compressed
+io.attribute.device
+io.attribute.directory
+io.attribute.encrypted
+io.attribute.hidden
+io.attribute.invalid
+io.attribute.normal
+io.attribute.offline
+io.attribute.readonly
+io.attribute.sparsefile
+io.attribute.system
+io.attribute.temporary
+io.attribute.virtual
+Retrieves file system attributes for a specified path.
+Syntax
+io.attributes(path)attribute verification
+// check if path is hidden
+io.attribute.hidden(path)
+
+// check if path is directory
+io.attribute.directory(path)
+
+var { atrr = io.attributes(path) }
+
+// check if attr is hidden
+io.attribute.hidden(atrr)
+
+// check if attr is directory
+io.attribute.directory(atrr)
+Copies an existing file to a new file.
+Syntax
+io.copy(pathFrom, pathTo)
+Moves an existing file or a directory, including its children..
+Syntax
+io.move(oldPath, newPath)
+Rename a file or directory.
+Syntax
+io.rename(oldName, newName)
+Deletes an existing path.
+Syntax
+io.delete(path)
+Create new directory.
+Syntax
+io.directory.create(path)
+Check if one or more directories exists.
+Syntax
+io.directory.exists(path)
+ io.directory.exists(path1, path2, path3, ...)
+Check if one or more directory is empty.
+Syntax
+io.directory.empty(path)
+ io.directory.empty(path1, path2, path3, ...)
+Retrieves the size of the specified file, in bytes.
+Syntax
+io.file.size(path)
+Check if one or more files exists.
+Syntax
+io.file.exists(path)
+ io.file.exists(path1, path2, path3, ...)
+Read file contents as text with character count option.
+Syntax
+io.file.read(path)io.file.read(path, 12)
+Create new file with content option.
+Syntax
+io.file.create(path)io.file.create(path, "Hello World!")
+Writing to a file with new content.
+Syntax
+io.file.write(path, "Hello World!")
+Appends text to an existing file, or to a new file if the specified file does not exist.
+Syntax
+io.file.append(path, "Hello ")
+ io.file.append(path, "World!")
+Keyboard functions
+key.alt
+key.apps
+key.back
+key.cancel
+key.capital
+key.capslock
+key.control
+key.delete
+key.down
+key.end
+key.enter
+key.escape
+key.execute
+key.f1
+key.f10
+key.f11
+key.f12
+key.f2
+key.f3
+key.f4
+key.f5
+key.f6
+key.f7
+key.f8
+key.f9
+key.help
+key.home
+key.insert
+key.lalt
+key.lcontrol
+key.left
+key.lshift
+key.lwin
+key.next
+key.none
+key.pagedown
+key.pageup
+key.pause
+key.play
+key.print
+key.printscreen
+key.prior
+key.ralt
+key.rcontrol
+key.return
+key.right
+key.rshift
+key.rwin
+key.shift
+key.snapshot
+key.space
+key.tab
+key.up
+key.win
+Syntax
+
+// check if SHIFT key is pressed
+key(key.shift)
+
+// or
+key == key.shift
+
+// or
+key.shift()
+
+// check if tow keys (SHIFT+CTRL+X) is pressed
+key(key.shift, key.control)
+
+// check if keys (SHIFT+CTRL+X) is pressed
+key(key.shift, key.control, 87)
+
+Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.
+ ++msg(text) +msg(text, title) +msg(text, title, flags) ++
| text | +The message to be displayed. | +
| title | +The dialog box title. If this parameter is NULL, the default title is Nilesoft Shell. | +
| flags | +The contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags. | +
If a message box has a Cancel button, the function returns the msg.idcancel value if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing ESC will no effect - unless an msg.ok button is present. If an msg.ok button is displayed and the user presses ESC, the return value will be msg.idok.
If the function fails, the return value is zero.
+If the function succeeds, the return value is one of the following values:
+
msg("Hello, Warld!","NileSoft Shell", msg.info | msg.ok)
+msg("Hello, Warld!","NileSoft Shell")
+msg("Hello, Warld!")
+Plays a waveform sound. The waveform sound for each sound type is identified by an entry in the registry.
+Syntax
+sys.beepsys.beep(msg.error)sys.beep(msg.warning)
+Combines an array of strings into a path.
+Syntax
+path.combine(path1, path2)path.combine("C:", "Windows", "Explorer.exe")
+Retrieves the current directory for the current process.
+Syntax
+path.currentdirectory
+Return the directory name from the path.
+Syntax
+path.directory.name('c:\windows\system32') // returns: system32
+Shows the directory selection box and returns the path of the specified directory.
+Syntax
+path.directory.box
+Check if one or more path is empty.
+Syntax
+path.empty(path)path.empty(path1, path2, ...)
+Check if one or more path exists..
+Syntax
+path.exists(path)path.exists(path1, path2, ...)
+Returns the absolute path for the specified path string.
+Syntax
+path.full(path)
+Retrieves the short path form of the specified path.
+Syntax
+path.short(path)
+Return the name from the path.
+Syntax
+path.name(path)
+Return the path of the parent
+Syntax
+path.location(path)
+Return the name from the parent
+Syntax
+path.location.name(path)
+Return the drive path
+Syntax
+path.root(path)
+Return the title from the path
+Syntax
+path.title(path)
+Return the type of path
+Syntax
+path.type(path) == type.file
+Return the name of path
+Syntax
+path.file.name(path)
+Return the name of path without extension
+Syntax
+path.file.title(path)
+Return the extension of path
+Syntax
+path.file.ext(path)
+Shows the file selection box and returns the path of the specified file.
+Syntax
+path.file.boxpath.file.box('All|*.*|Text|*.txt')path.file.box('exe|*.exe', 'c:\windows')path.file.box('exe|*.exe', 'c:\windows', 'explorer.exe')
+Syntax
+path.isabsolute(path)
+Syntax
+path.isrelative(path)
+Syntax
+path.isfile(path)
+Syntax
+path.isdirectory(path)
+Syntax
+path.isdrive(path)
+Syntax
+path.isclsid(path)
+Syntax
+path.isexe(path)
+Remove the extension from the passed parameter.
+Syntax
+path.removeextension
+Return a path from the shortcut
+Syntax
+path.lnktarget
+Retrieves the full path of a known folder identified.
+Syntax
+path.getknownfolder('{905e63b6-c1bf-494e-b29c-65b732d3d21a}')
+Replacing the back slash with a forward slash or defining a spacer.
+Syntax
+path.separator('c:\windows\system32') return "c:/windows/system32"path.separator('c:\windows\system32', '#') return "c:#windows#system32"
+Registary functions
+Syntax
+reg.cr // HKEY_CLASSES_ROOT
+reg.cu // HKEY_CURRENT_USER
+reg.lm // HKEY_LOCAL_MACHINE
+reg.u // HKEY_USERS
+reg.cc // HKEY_CURRENT_CONFIG
+Syntax
+reg.none // No data type
+reg.sz // REG_SZ
+reg.expand // REG_EXPAND_SZ
+reg.binary // REG_BINARY
+reg.multi // REG_MULTI_SZ
+reg.dword // REG_DWORD
+reg.qword // REG_QWORD
+Syntax
+reg(reg.lm, 'SOFTWARE\Microsoft\Windows NT\CurrentVersion','ProductName')reg(reg.cr, 'txtfile\DefaultIcon')
+Has many functions to handle selected file system objects.
++
false, separator=' ')Returns all selected items with double quotation mark and custom separator.
+sel
sel(true)
sel(true, "\n")
+
++
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0)+
0)+
0)+
0)+
0)Returns a character from a specific location in the string.
+Syntax
+str.get("Hello World!", 7)
+Sets a character with a specific location in the string.
+Syntax
+str.set("Hello World!", 6, '-')
+Returns a value indicating whether a specified substring occurs within this string.
+Syntax
+str.contains("Hello World!", 'World')
+Tests whether the string contains characters.
+Syntax
+str.empty("")
+Checks whether the string starts with the specified prefix.
+Syntax
+str.start("Hello World!", "World!")
+Checks whether the string ends with the specified suffix.
+Syntax
+str.end("Hello World!", "World!")
+Determines whether two String have the same value.
+Syntax
+str.equals("Hello World!", "Hello World!")
+Determine if two strings do not have the same value.
+Syntax
+str.not("Hello World!", "Hello-World!")
+Gets the number of characters in the current string.
+Syntax
+str.length("Hello World!")
+Returns a new string in which all leading and trailing occurrences of a set of specified characters from the current string are removed.
+Syntax
+Removes all leading and trailing white-space characters from the current string.
+str.trim(" Hello World! ")Removes all leading and trailing 'H!' characters from the current string.
+str.trim("Hello World!", "H!")
+Returns a new string in which all leading occurrences of a set of specified characters from the current string are removed.
+Syntax
+Removes all leading white-space characters from the current string.
+str.trimstart(" Hello World!")Removes all leading 'H' characters from the current string.
+str.trimstart("Hello World!", "H")
+Returns a new string in which all trailing occurrences of a set of specified characters from the current string are removed.
+Syntax
+Removes all trailing white-space characters from the current string.
+str.trimend("Hello World! ")Removes all trailing '!' characters from the current string.
+str.trimend("Hello World!", "!")
+Searches a string in a forward direction for the first occurrence of a substring that matches a specified sequence of characters.
+Syntax
+str.find("Hello World!", "lo")
+Searches a string in a backward direction for the first occurrence of a substring that matches a specified sequence of characters.
+Syntax
+str.findlast("Hello World!", "Wor")
+Returns a copy of this string converted to lowercase.
+Syntax
+str.lower("Hello World!")
+Returns a copy of this string converted to uppercase.
+Syntax
+str.upper("Hello World!")
+Extracts the left part of a string.
+Syntax
+str.left("Hello World!", 5)
+Extracts the right part of a string.
+Syntax
+str.right("Hello World!", 5)
+Copies a substring of at most some number of characters from a string beginning from a specified position.
+Syntax
+str.sub("Hello World!", 5)str.sub("Hello World!", 0, 5)
+Removes an element or a range of elements in a string from a specified position.
+Syntax
+str.replace("Hello World!", " ")str.remove("Hello World!", 5)str.remove("Hello World!", 5, 1)
+Replace elements in a string at a specified position with specific characters or characters copied from other ranges or strings.
+Syntax
+str.replace("Hello World!", "World", "User")str.replace("Hello World!", "world", "user", true)
+Returns a new string of a specified length in which the beginning of the current string is padded with spaces or with a specified character.
+Syntax
+str.padleft("Hello World!", "*")str.padleft("Hello World!", "*", 3)
+Returns a new string of a specified length in which the end of the current string is padded with spaces or with a specified character.
+Syntax
+str.padright("Hello World!", "*")str.padright("Hello World!", "*", 3)
+Returns a new string of a specified length in which the start and end of the current string is padded with spaces or with a specified character.
+Syntax
+str.padding("Hello World!", "*")str.padding("Hello World!", "*", 3)
+Returns a new guid string
+Syntax
+str.guid return 00000000000000000000000000000000 str.guid(1) return 00000000-0000-0000-0000-000000000000 str.guid(2) return {00000000-0000-0000-0000-000000000000} str.guid(3) return (00000000-0000-0000-0000-000000000000) Returns a new capitalize string
+Syntax
+str.capitalize('hello world') return "Hello World" Returns a string resource from the executable file. "shell32.dll" is the default file.
+Syntax
+str.res(-4640) return "Runs the selected command with elevation" from "shell32.dll"str.res('explorer.dll', -22000) return "Desktop" Returns Windows name.
+Syntax
+sys.name
+Returns Windows name.
+Syntax
+sys.name
+Returns system architecture.
+Syntax
+sys.type
+Returns system architecture.
+Syntax
+sys.type == 64sys.type == 32
+Returns if system architecture is x64.
+Syntax
+sys.is64
+Check if dark mode is enabled.
+Syntax
+sys.dark
+Retrieves the value of an environment variable.
+Syntax
+sys.var('WINDIR')
+Windows version.
+Syntax
+sys.version
+sys.version.build
+sys.version.major
+sys.version.minor
+sys.version.name
+sys.version.type
+Date and time format
+Syntax
+sys.datetime
+sys.datetime.date
+sys.datetime.date_day
+sys.datetime.date_dayofweek
+sys.datetime.date_month
+sys.datetime.date_y
+sys.datetime.date_year
+sys.datetime.date_yy
+sys.datetime.short
+sys.datetime.time
+sys.datetime.time_hour
+sys.datetime.time_milliseconds
+sys.datetime.time_min
+sys.datetime.time_minute
+sys.datetime.time_ms
+sys.datetime.time_pm
+sys.datetime.time_second
+sys.appdata
+sys.bin
+sys.bin32
+sys.bin64
+sys.directory (sys.dir)
+sys.path
+sys.prog
+sys.prog32
+sys.programdata
+sys.random
+sys.refresh
+sys.root
+sys.temp
+sys.templates
+sys.users
+sys.wow
+Suspends the execution of the current thread until the time-out interval elapses.
+Syntax
+sys.sleep(1000)
+
+sys.toggleext
+sys.togglehidden
+
diff --git a/docs/functions/user.html b/docs/functions/user.html
new file mode 100644
index 0000000..250dab2
--- /dev/null
+++ b/docs/functions/user.html
@@ -0,0 +1,36 @@
+Returns the current username.
+Syntax
+user.name
+Syntax
+user.home
+user.appdata
+user.contacts
+user.desktop
+user.directory (user.dir)
+user.documents
+user.documentslibrary
+user.downloads
+user.favorites
+user.libraries
+user.localappdata
+user.music
+user.personal
+user.pictures
+user.profile
+user.quicklaunch
+user.sendto
+user.startmenu
+user.temp
+user.templates
+user.videos
+
+
+ This tutorial will teach you the basics of Shell.
+ It is not necessary to have any prior experience.
+
+ To start using Shell, you need:
+ A text editor, like Notepad, to write Shell code.
+
Let's create our first menu item.
+Open configuration file (shell.shl) and Write the following code and save.
+shell
+{
+ dynamic
+ {
+ item(title='Hello, World!')
+ }
+}
+Don't worry if you don't understand the code above - we will discuss it in detail in later chapters.
+The result will look something for this when you press the right-click in an empty place on the desktop:
+
+
+Congratulations You have now added the first time a menu item to the context menu
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..81cb7d9 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,32 @@ ++ Shell is a extensions of Windows File Explorer that can be used to create high-performance context menu items. + and gives user a high level of control over context menu of Windows File Explorer. +
+The Right Click Menu or the Context Menu is the menu, which appears when you right-click on the desktop, file, folder or taskbar in Windows. This menu gives you added functionality by offering you actions you can take with the item
+Shell is all you need to customize or add new items with several functions to Windows File Explorer Context menu and Much More.(cascade menus, advanced menus, multi-level menus, command menus, separator).
+ +
+
+Download the release package and unzip its content in any location you want.
+Open an elevated command prompt.
+shell -[options]
+| -register (-r) | +Registering. | +
| -unregister (-u) | +Unregistering. | +
| -init (-i) | +Initialize images cache. | +
| -restart (-re) | +Restart Windows Explorer. | +
| -silent (-s) | +Prevents displaying messages. | +
| -? | +Dispay this help message. | +
shell -register -init
+shell -unregister -restart
+ Tip: Close all instances of Windows File Explorer before uninstalling to avoid needing a reboot after it has been uninstalled.
+Default are containers for storing default values.
+ +shell
+{
+ default
+ {
+ // view = auto, compact, small, medium, large, wide
+ view = view.compact
+
+ // theme = auto, dark, light, white, black
+ theme = theme.black
+
+ // text = [normal, hover, disabled]
+ text = [#ffffff, default, #808080]
+
+ // block = [normal, hover, radius]
+ block = [#000, #444, 5]
+
+ // separator = [color, size]
+ separator = [#ff00ff, 1]
+
+ // frame = [border color, border size]
+ frame = [#000, 3]
+
+ // font = [size, font name]
+ font = [12, 'Brush Script']
+
+ // Chevron, Check Mark, Radio Bullet
+ symbol = #ff0000
+
+ // Enable/Disable drop shadow
+ shadow = false
+ }
+}
+
diff --git a/docs/syntax/dynamic.html b/docs/syntax/dynamic.html
new file mode 100644
index 0000000..03e71a9
--- /dev/null
+++ b/docs/syntax/dynamic.html
@@ -0,0 +1,389 @@
+This section adds new menu items to the context menu.
+Dynamic items have three types (menu, item, and separator). with properties to add new items with customization explained below in more details.
The types (menu and item) must contain the property title at least and their value cannot be null.
A separator-type item can be added without any properties.
In the following example, it shows how to write add an items to dynamic:
+shell
+{
+ dynamic
+ {
+ item(title = 'Hello, World!')
+ separtor
+ menu(title = 'sub menu' image = #0000ff)
+ {
+ item(title = 'test subitem')
+ }
+ }
+}
+| Property | +Summary | +||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Where | +Allow menu item to be passed if a true value is returned + Default = true + |
+ ||||||||||||||||||||||||||||||
| Title | +Sets a value indicating the caption of the menuitem. + This property must be included with menu and item if image propery is not defined, not required for separator. + Default = null +Required for menu, item. + |
+ ||||||||||||||||||||||||||||||
| Mode | +Accept item by selections behavior. Value have one of the following parameters:
+
Required for menu, item, separator. + |
+ ||||||||||||||||||||||||||||||
| Type | +Specify the types of object files allowed for the menu item to appear. The property is assigned to one or more of these parameters and this character | is used to separate types.+ Add a character ~ before single type to exclude.
+ The property not supported syntax expressions. +
Required for menu, item, separator. + |
+ ||||||||||||||||||||||||||||||
| Visibility (vis) | +Visibility of menuitem and can have one of the following parameters:
+
Required for menu, item, separator. + |
+ ||||||||||||||||||||||||||||||
| Find | +
+ Accept menuitem when the specified path name or path extension is contains or equal to the current find property. Required for menu, item, separator. + |
+ ||||||||||||||||||||||||||||||
| Separator (sep) | +Add separator with menuitem position by parameters:
+
Required for menu, item. + |
+ ||||||||||||||||||||||||||||||
| Position (pos) | +The position at which a menuitem should be inserted into the menu. Position can have one of the following parameters: +
Required for menu, item, separator. + |
+ ||||||||||||||||||||||||||||||
| Image | +The icon that appears in a menuitem, This property can be assigned as image files, resource icons, glyph or color. With one of the following parameters
+
Required for menu, item. + |
+ ||||||||||||||||||||||||||||||
| Parent | +Move current item to another menu. + Default = null |
+ ||||||||||||||||||||||||||||||
| Command (cmd) | +The command associated with the menuitem. Occurs when the menuitem is clicked or selected using a shortcut key or access key defined for the menuitem. + Default = null +Required for item. + |
+ ||||||||||||||||||||||||||||||
| Arguments (arg, args) | +The parameter to pass to the Command property of a menuitem. + Default = null +Required for item. + |
+ ||||||||||||||||||||||||||||||
| Window | +Controls how the window is to be shown. can be one of the following parameters:
+ Hidden, Show, Visible, Minimized, Maximized + Default = show +Required for item. + |
+ ||||||||||||||||||||||||||||||
| Directory (dir) | +Specify the work directory to execute the command. + Default = null +Required for item. |
+ ||||||||||||||||||||||||||||||
| admin | +Execute the command with administrative permissions. + Default = false +Required for item. + |
+ ||||||||||||||||||||||||||||||
| Verb | +Specifies that the operation is the default for the selected file. value type string and can have one of the following parameters: +
Required for item. + |
+ ||||||||||||||||||||||||||||||
| Wait | +
+ Waiting Until end of command. + Default = false +Required for item. + |
+ ||||||||||||||||||||||||||||||
| Checked | +Value that indicates whether the menuitem is checked. + Default = false +Required for item. + | ||||||||||||||||||||||||||||||
| Default | +
+ Specifies that the menuitem is the default. A menu can contain only one default menuitem, which is displayed in bold. + Default = false +Required for item. + |
+ ||||||||||||||||||||||||||||||
| Column(col) | +Create a new column. + Default = true +Required for item, menu. + |
This chapter describes the syntax rules for configuration file.
+=) sign are optional and are ignored.( ).Tip: When there is an error, it is recorded in the log file (shell.log).
+ +The following rules apply to the syntax of configuration file (shell.shl):
+shell
+{
+ // global variables
+ var
+ {
+ // variables content
+ variable-name = variable-value
+ ...
+ }
+
+ default
+ {
+ // defaults content
+ default-name = default-value
+ default-name = [default-value, default-value, ...]
+ ...
+ }
+
+ // static items
+ static
+ {
+ // static items content
+ item ( property-name = property-value ... )
+ ...
+ }
+
+ // dynamic items
+ dynamic
+ {
+ // dynamic items content
+ item ( property-name = property-value ... )
+
+ separator [( property-name = property-value ... )]
+
+ menu ( property-name = property-value ... )
+ {
+ var // local variables
+ {
+ variable-name = variable-value
+ ...
+ }
+
+ item ( property-name = property-value ... )
+ ...
+ }
+ ...
+ }
+}
+
+Breaking Long Lines
For best readability, users often like to avoid lines longer than 80 characters. single quotes also allow break up a line.
shell
+{
+ dynamic
+ {
+ item(title='Command prompt'
+ cmd='cmd.exe')
+ }
+}
diff --git a/docs/syntax/static.html b/docs/syntax/static.html
new file mode 100644
index 0000000..75d22e2
--- /dev/null
+++ b/docs/syntax/static.html
@@ -0,0 +1,199 @@
+This section modifies context menu items added by the system or by a third party. more than one item can be added with some properties to customize the context menu. explained below in more details.
The items must have the property find. to search in the titles of the menu items to catches them and customize by other properties such as changing the title, icon, visibility, or moving it to another location.
In the following example, it shows how to write add an items to static:
+shell
+{
+ static
+ {
+ item(find = 'copy' image = #00ff00)
+ item(find = 'paste' image = #0000ff)
+ }
+}
+| Property | +Summary | +||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Where | +Allow menu item to be passed if a true value is returned + Default = true + |
+ ||||||||||||
| Find | +Accept menuitem when the specific menuitem title is contains or equal to the current find property. Use this delimiter | to separate patterns.
+ This property must be included with another property at least if where property is not defined. + Default = null + |
+ ||||||||||||
| Title | +
+ Change value indicating the caption of the menuitem. + Default = null + |
+ ||||||||||||
| Mode | +Accept item by selections behavior. Value have one of the following parameters:
+
|
+ ||||||||||||
| Visibility (vis) | +Visibility of menuitem and can have one of the following parameters:.
+
|
+ ||||||||||||
| Position (pos) | +The position at which a menuitem should be inserted into the menu. Position can have one of the following parameters: +
|
+ ||||||||||||
| Separator (sep) | +Add separator with menuitem position by parameters:
+
|
+ ||||||||||||
| Image | +The icon that appears in a menuitem, This property can be assigned as image files, resource icons, glyph or color. With one of the following parameters
+
|
+ ||||||||||||
| Parent | +Move current menu item(s) to another menu. + Default = null |
+ ||||||||||||
| Default | +
+ Specifies that the menuitem is the default. A menu can contain only one default menuitem, which is displayed in bold. + Default = false + |
+
Variables are containers for storing data values.
+The general rules for constructing names for variables (unique identifiers) are:
+_).
+ All variables must be identified with unique names.
+ These unique names are called identifiers.
+ Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume).
+
Note: It is recommended to use descriptive names in order to create understandable and maintainable code
+shell
+{
+ var
+ {
+ hello_world = 'Hello World!'
+ test_add1 = 5 + 6
+ }
+
+ dynamic
+ {
+ item(title = @hello_world cmd = @msg(hello_world))
+
+ menu(title = @test_add1)
+ {
+ var
+ {
+ test_sub1 = 11 - 5
+ }
+
+ item(title = @test_sub1)
+ }
+ }
+}
+