本文主要是介绍Opera 内部命令语法详解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Syntax | 语法
A general syntax for a single command:
Opera 内部命令基本语法:
Example | 示例
Show popup menu is the action, "Browser Menu Bar" is the property to pass to the command and "Menu" is an icon defined in a skin file. Note that all the comma delimiters are entered even if that portion is blank.
显示弹出菜单是动作,"Browser Menu Bar"是传递给命令的属性,"Menu"是皮肤文件中定义图标名称。注意,指定了图标后,即使中间部分参数为空,相应逗号分隔符也不能省略。
Combining Actions: Alternative | 组合动作: 或
| is similar to an OR operator: if the first action doesn't work, then the second will be used instead. In the following example Opera cannot execute 'Enter Fullscreen' if it already is fullscreen. More than two actions can be used, too:
| 号类似 OR 操作符: 如果第一个动作不能使用,则使用第二个。下列示例中 Opera 不能在已全屏的情况下执行 'Enter Fullscreen'。也可使用两个以上动作:
Combining Actions: Conjunction | 组合动作: 与
& is the concatenation operator, allowing you to string several commands to perform in order. Note that the actions are taken almost simultanously, not one by one so don't rely on one command finishing before the other starts:
& 号为串联操作符,允许顺序执行多个命令。不过要注意实际上动作几乎是同时执行的,并非依次进行,因此下一命令的开始不依赖前一命令的结束。
Combining Actions: Extra Dropdown | 组合动作: 附加下拉菜单
+ shows a small arrow which is normally used to add a dropdown menu. However, that small arrow can be used with any action:
+ 号显示小箭头,通常用于添加下拉菜单。不过小箭头也可用于各种动作。
<strong>Combining Actions: Cycler | 组合动作: 循环</strong>
> is a command cycler introduced in V7.5 — it cycles from one command to the next through the list, and guarantees the name/icon can change at each state:
> 是 v7.5 引入的循环命令 — 循环执行列表中的命令,确保名称/图标可在每个状态下改变:
Combining Actions: Icon Placement | 组合命令: 图标位置
When you make multiple action commands, you may wish to add an icon or title. The icon must then be appended to the first command:
组合多项动作命令时,可能希望添加一个图标或者标题,这时图标必须添加在第一个命令中:
You can also pass selected or predefined text, the URL or the cache file path to a command, see
IniFileVariables for more information:
也可向命令传递当前选定或预定义的文本、URL 地址或缓存中的文件路径:
Opera uses a range of special variables that can be used in some of these INI commands (not all):
Opera 使用了一些特殊变量,可用于某些 INI 命令 (并非全部):
%s is the filename of local source cache | 本地缓存文件名
%t is currently selected text | 当前选定的文本
%c is the clipboard content | 剪贴板中的内容
%u is active document url | 当前页面地址
%l is the address of a link you right-click | 右键点击的链接
NOTE: If the letter is written in uppercase (ie. %S) the parameter is put inside a pair of quotes ("). This is useful for instance if you want to open some document from the cache in a source viewer because the path to the file may contain spaces.
注意: 如果字母大写 (如: %S ) 则参数包含在双引号(")之间。此功能非常有用,比如使用其他源码查看器打开缓存页面时,地址可能包含空格,这时就需要用引号进行限定。
A general syntax for a single command:
Opera 内部命令基本语法:
- 代码: 全选
-
Action, property1, property2, label, icon
(动作, 属性1, 属性2, 标题, 图标)
Example | 示例
- 代码: 全选
-
Show popup menu, "Browser Menu Bar", , , "Menu"
Show popup menu is the action, "Browser Menu Bar" is the property to pass to the command and "Menu" is an icon defined in a skin file. Note that all the comma delimiters are entered even if that portion is blank.
显示弹出菜单是动作,"Browser Menu Bar"是传递给命令的属性,"Menu"是皮肤文件中定义图标名称。注意,指定了图标后,即使中间部分参数为空,相应逗号分隔符也不能省略。
Combining Actions: Alternative | 组合动作: 或
| is similar to an OR operator: if the first action doesn't work, then the second will be used instead. In the following example Opera cannot execute 'Enter Fullscreen' if it already is fullscreen. More than two actions can be used, too:
| 号类似 OR 操作符: 如果第一个动作不能使用,则使用第二个。下列示例中 Opera 不能在已全屏的情况下执行 'Enter Fullscreen'。也可使用两个以上动作:
- 代码: 全选
-
Enter fullscreen | Leave fullscreen
Combining Actions: Conjunction | 组合动作: 与
& is the concatenation operator, allowing you to string several commands to perform in order. Note that the actions are taken almost simultanously, not one by one so don't rely on one command finishing before the other starts:
& 号为串联操作符,允许顺序执行多个命令。不过要注意实际上动作几乎是同时执行的,并非依次进行,因此下一命令的开始不依赖前一命令的结束。
- 代码: 全选
-
Scroll down & Scroll down & Scroll down
Combining Actions: Extra Dropdown | 组合动作: 附加下拉菜单
+ shows a small arrow which is normally used to add a dropdown menu. However, that small arrow can be used with any action:
+ 号显示小箭头,通常用于添加下拉菜单。不过小箭头也可用于各种动作。
- 代码: 全选
-
Rewind + Show popup menu, "Internal Rewind History"
Save document As,,,"Save" + Save document with images as
<strong>Combining Actions: Cycler | 组合动作: 循环</strong>
> is a command cycler introduced in V7.5 — it cycles from one command to the next through the list, and guarantees the name/icon can change at each state:
> 是 v7.5 引入的循环命令 — 循环执行列表中的命令,确保名称/图标可在每个状态下改变:
- 代码: 全选
-
Set alignment, "document view toolbar", 0, "Show" > Set alignment, "document view toolbar", 6, "Hide"
Combining Actions: Icon Placement | 组合命令: 图标位置
When you make multiple action commands, you may wish to add an icon or title. The icon must then be appended to the first command:
组合多项动作命令时,可能希望添加一个图标或者标题,这时图标必须添加在第一个命令中:
- 代码: 全选
-
Copy image,,,,"Window Document Icon" & Execute program, "i_view32.exe", "/clippaste"
You can also pass selected or predefined text, the URL or the cache file path to a command, see
IniFileVariables for more information:
也可向命令传递当前选定或预定义的文本、URL 地址或缓存中的文件路径:
Opera uses a range of special variables that can be used in some of these INI commands (not all):
Opera 使用了一些特殊变量,可用于某些 INI 命令 (并非全部):
%s is the filename of local source cache | 本地缓存文件名
%t is currently selected text | 当前选定的文本
%c is the clipboard content | 剪贴板中的内容
%u is active document url | 当前页面地址
%l is the address of a link you right-click | 右键点击的链接
NOTE: If the letter is written in uppercase (ie. %S) the parameter is put inside a pair of quotes ("). This is useful for instance if you want to open some document from the cache in a source viewer because the path to the file may contain spaces.
注意: 如果字母大写 (如: %S ) 则参数包含在双引号(")之间。此功能非常有用,比如使用其他源码查看器打开缓存页面时,地址可能包含空格,这时就需要用引号进行限定。
这篇关于Opera 内部命令语法详解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!