Differences
This shows you the differences between the selected revisions of the page.
| extension_generate_http_url 2018-07-04 | extension_generate_http_url 2020-09-22 (current) | ||
| Line 2: | Line 2: | ||
| This extension allows you to generate HTTP URL of the selected file. | This extension allows you to generate HTTP URL of the selected file. | ||
| - | For the extension to work correctly, you may need to configure web root folder and possible other options. | + | For the extension to work correctly, you may need to configure web root folder and possibly other options. | 
| ~~AD~~ | ~~AD~~ | ||
| Line 10: | Line 10: | ||
| <code powershell - GenerateHttpUrl.ps1> | <code powershell - GenerateHttpUrl.ps1> | ||
| # @name Generate &HTTP URL | # @name Generate &HTTP URL | ||
| - | # @command powershell.exe -ExecutionPolicy Bypass -STA -NoProfile -File "%EXTENSION_PATH%" -webRoot "%WebRoot%" -rootPath "%RootPath%" -hostName "%HostName%" -serverName "!@" -path "!/" %Https% %Pause% %Clipboard% %Open% !& | + | # @command powershell.exe -ExecutionPolicy Bypass -STA -NoProfile ^ | 
| + | # -File "%EXTENSION_PATH%" -webRoot "%WebRoot%" -rootPath "%RootPath%" ^ | ||
| + | # -hostName "%HostName%" -serverName "!@" -path "!/" %Https% %Pause% ^ | ||
| + | # %Clipboard% %Open% !& | ||
| # @description Generates HTTP URL of the selected file | # @description Generates HTTP URL of the selected file | ||
| # @flag RemoteFiles | # @flag RemoteFiles | ||
| # @flag ShowResultsInMsgBox | # @flag ShowResultsInMsgBox | ||
| - | # @version 4 | + | # @version 5 | 
| # @homepage ~~SELF~~ | # @homepage ~~SELF~~ | ||
| - | # @require WinSCP 5.10 | + | # @require WinSCP 5.12 | 
| # @option - -site group "URL" | # @option - -site group "URL" | ||
| # @option - -site label "These options are site-specific." | # @option - -site label "These options are site-specific." | ||
| Line 23: | Line 26: | ||
| # @option RootPath -site textbox "&URL root path (optional):" | # @option RootPath -site textbox "&URL root path (optional):" | ||
| # @option HostName -site textbox "&Web server hostname override (optional):" | # @option HostName -site textbox "&Web server hostname override (optional):" | ||
| + | # @option - group "Options" | ||
| + | # @option Pause checkbox "Display URL" "-pause" "-pause" | ||
| + | # @option Clipboard checkbox "Copy URL to clipboard" "-clipboard" "-clipboard" | ||
| + | # @option Open checkbox "Open URL in web browser" "" "-open" | ||
| # @optionspage ~~SELF~~#options | # @optionspage ~~SELF~~#options | ||
| Line 109: | Line 116: | ||
| Write-Host -NoNewline $result | Write-Host -NoNewline $result | ||
| } | } | ||
| + | |||
| + | if ($clipboard) | ||
| + | { | ||
| Add-Type -Assembly PresentationCore | Add-Type -Assembly PresentationCore | ||
| [Windows.Clipboard]::SetText($result) | [Windows.Clipboard]::SetText($result) | ||
| + | } | ||
| $result = 0 | $result = 0 | ||
| Line 119: | Line 129: | ||
| Write-Host "Error: $($_.Exception.Message)" | Write-Host "Error: $($_.Exception.Message)" | ||
| $result = 1 | $result = 1 | ||
| - | $pause = $true | ||
| } | } | ||
| Line 125: | Line 134: | ||
| </code> | </code> | ||
| - | ===== Options ===== | + | ===== [[options]] Options ===== | 
| &screenshotpict(extension_generate_http_url) | &screenshotpict(extension_generate_http_url) | ||
| Line 148: | Line 157: | ||
| Check the //Open %%URL%% in web browser// to open the generated URL in your web browser. | Check the //Open %%URL%% in web browser// to open the generated URL in your web browser. | ||
| + | |||
| + | In the //Keyboard shortcut//, you can specify a [[custom_key_shortcuts|keyboard shortcut]] for the extension. | ||
| ~~NOTOC~~ | ~~NOTOC~~ | ||