Differences
This shows you the differences between the selected revisions of the page.
2016-06-22 | 2016-07-22 | ||
5.8.4 Run time options for extensions. (martin) | not beta (martin) | ||
Line 11: | Line 11: | ||
* Local commands that are executed on the local machine with remote files downloaded to a [[temp_folders|temporary folder]]. You must have remote files selected first in order to execute the command. If the command modifies the files, the changes are uploaded to the server. | * Local commands that are executed on the local machine with remote files downloaded to a [[temp_folders|temporary folder]]. You must have remote files selected first in order to execute the command. If the command modifies the files, the changes are uploaded to the server. | ||
* Local commands that are executed on the local machine with paths to a remote files. Such commands will typically operate on the files over their own session (use ''!S'' pattern to pass current session settings to the command). The command may use [[guide_custom_commands_automation|WinSCP .NET assembly or scripting]]. | * Local commands that are executed on the local machine with paths to a remote files. Such commands will typically operate on the files over their own session (use ''!S'' pattern to pass current session settings to the command). The command may use [[guide_custom_commands_automation|WinSCP .NET assembly or scripting]]. | ||
- | * Local commands that work with local commands. The command can work completely with selected local files only. Or it can for example process the local somehow (compress them) and upload them to the remote server using own session (again, use the ''!S'' pattern as mentioned previously). &beta_feature | + | * Local commands that work with local commands. The command can work completely with selected local files only. Or it can for example process the local somehow (compress them) and upload them to the remote server using own session (again, use the ''!S'' pattern as mentioned previously). |
* Special type is a local command that is executed with both local and remote files. This is particularly useful for running "diff" tools. This type is available only with the [[ui_commander|Commander interface]]. You can execute these commands on a set of remote files against the the same number of local files (once for each pair). Another option is to execute it on a set of remote files against one local file (once for each remote file) and vice versa. | * Special type is a local command that is executed with both local and remote files. This is particularly useful for running "diff" tools. This type is available only with the [[ui_commander|Commander interface]]. You can execute these commands on a set of remote files against the the same number of local files (once for each pair). Another option is to execute it on a set of remote files against one local file (once for each remote file) and vice versa. | ||
Line 25: | Line 25: | ||
| ''!U'' | Any | Current session username. | | | ''!U'' | Any | Current session username. | | ||
| ''!P'' | Any | Current session password (if [[security_credentials|stored or remembered]]). | | | ''!P'' | Any | Current session password (if [[security_credentials|stored or remembered]]). | | ||
- | | ''!#'' | Any | Current session port number. &beta_feature | | + | | ''!#'' | Any | Current session port number. | |
- | | ''!N'' | Any | Current session name. &beta_feature | | + | | ''!N'' | Any | Current session name. | |
| ''!?prompt[\]?default!'' | Any | When used, user is prompted to enter value that replaces the pattern. ''prompt'' can define a message of the prompt and ''default'' a default value, both can be empty. Special characters entered by user are automatically delimited. You can prohibit this using optional backslash (''\'') before second question mark (''?''). \\ When implementing an [[extension]], use a runtime [[extension#options|option]] instead, as a more flexible alternative. | | | ''!?prompt[\]?default!'' | Any | When used, user is prompted to enter value that replaces the pattern. ''prompt'' can define a message of the prompt and ''default'' a default value, both can be empty. Special characters entered by user are automatically delimited. You can prohibit this using optional backslash (''\'') before second question mark (''?''). \\ When implementing an [[extension]], use a runtime [[extension#options|option]] instead, as a more flexible alternative. | | ||
| ''!`command`'' | Any | Replaced with output of a given local console command. \\ The command can also be used solely for its side effect, without actually outputting anything. | | | ''!`command`'' | Any | Replaced with output of a given local console command. \\ The command can also be used solely for its side effect, without actually outputting anything. | | ||
| ''%%!^!%%'' | Local | Full path to a local file. In general it should be used in a combination with ''!'' or ''!&''. Command with the pattern will be executed once for every selected local file, unless only one local file and several remote files are selected and pattern ''!'' is used. Cannot be executed recursively. | | | ''%%!^!%%'' | Local | Full path to a local file. In general it should be used in a combination with ''!'' or ''!&''. Command with the pattern will be executed once for every selected local file, unless only one local file and several remote files are selected and pattern ''!'' is used. Cannot be executed recursively. | | ||
- | | ''!\'' | Local | Current local path. The path never ends with backslash. &beta_feature| | + | | ''!\'' | Local | Current local path. The path never ends with backslash. | |
The custom command is executed for files selected in [[ui_file_panel|file panel]]. It can be optionally executed also for selected directories or for files in selected directories (or both). | The custom command is executed for files selected in [[ui_file_panel|file panel]]. It can be optionally executed also for selected directories or for files in selected directories (or both). | ||
===== [[executing_and_configuring]] Executing and Configuring Custom Commands ===== | ===== [[executing_and_configuring]] Executing and Configuring Custom Commands ===== | ||
- | Custom commands that operate with files are located in menu //File(s) > File Custom Commands// (//File(s) > Custom Commands// in the latest stable version), &beta in file [[ui_context_menu|context menu]] and on special //[[ui_toolbars#custom_command|Custom Command toolbar]]//. | + | Custom commands that operate with files are located in menu //File(s) > File Custom Commands// (//File(s) > Custom Commands// in older versions), &recent in file [[ui_context_menu|context menu]] and on special //[[ui_toolbars#custom_command|Custom Command toolbar]]//. |
- | //In the latest beta version//, custom commands that do not operate with files are located in menu //Commands > Static Custom Commands//, and on special //[[ui_toolbars#custom_command|Custom Command toolbar]]//. //In the latest stable version//, custom commands that do not operate with files are located in the same menus as custom commands that operate with files. &beta | + | //In the recent versions//, custom commands that do not operate with files are located in menu //Commands > Static Custom Commands//, and on special //[[ui_toolbars#custom_command|Custom Command toolbar]]//. //In older versions//, custom commands that do not operate with files are located in the same menus as custom commands that operate with files. &recent |
Custom commands can be configured in [[ui_pref_commands|Preferences]]. | Custom commands can be configured in [[ui_pref_commands|Preferences]]. | ||
Line 46: | Line 46: | ||
===== [[debugging]] Debugging Custom Commands ===== | ===== [[debugging]] Debugging Custom Commands ===== | ||
- | If you want to test how the patterns in the custom command are expanded, hold down ''Shift'' and ''Ctrl'' keys, while executing the custom command. The command, with all patterns replaced, will get copied to the clipboard, instead of getting executed. &beta_feature | + | If you want to test how the patterns in the custom command are expanded, hold down ''Shift'' and ''Ctrl'' keys, while executing the custom command. The command, with all patterns replaced, will get copied to the clipboard, instead of getting executed. |
===== Useful Custom Commands ===== | ===== Useful Custom Commands ===== |