I often upload files to my ftp and give the link to someone. usually i have to use my browser and navigate to the folder where i put it in and add the filename to the url. to make this process faster i made a hotkey&button with this command:
Clipboard COPYNAMES=url REGEXP (ftp://|file:///)(.*)//(.*) http://\2/\3
it copies the paths of the selected files to clipboard and turns it into http urls. this command only works if the ftp and the http domains are the same.
the button code for a 3-way button also with Copy Local Path and Print Folder (i left the last one out because it was a stock command and in German):
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none" type="three_button">
<label>Copy paths</label>
<icon1>#clipcopy</icon1>
<icon2>#printfolder</icon2>
<button backcol="none" display="both" textcol="none">
<label>Copy filepaths</label>
<tip>Copy filepaths</tip>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>CLIPBOARD COPYNAMES</instruction>
</function>
</button>
<button backcol="none" display="both" textcol="none">
<label>Copy remote filepaths</label>
<tip>Copy remote filepaths</tip>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>Clipboard COPYNAMES=url REGEXP (ftp://|file:///)(.*)//(.*) http://\2/\3</instruction>
</function>
</button>
</button>
1 Like
Nice one.
I do the same thing with images.
Unfortunately, my ISP uses different names for ftp and web servers, but with luck I may be able to tweak your version.
PS Easy to do, although not elegant, simply substitute the relevant bit of the URL for the ftp address.
yeah, unfortunately there is no more elegant way.
I often upload files to my ftp and give the link to someone. usually i have to use my browser and navigate to the folder where i put it in and add the filename to the url. to make this process faster i made a hotkey&button with this command:
Clipboa…
Leo
May 9, 2011, 5:28am
4
There is an elegant way to solve the ftp and http domains being different, mentioned in that thread:
[quote="leo"]You can give the command you are using as many pairs of regex find & replace strings as you want.
So you could give the command a bunch of expressions which find one host/prefix and replace it with another, for example.[/quote]
Leo
May 9, 2011, 5:32am
5
e.g.
Clipboard COPYNAMES=url REGEXP (ftp|file)://ftp\.mysite\.org//(.*) http://www.mysite.org/\2
and you can give more than one find & replace pair:
Clipboard COPYNAMES=url REGEXP file://site_a//(.*) http://host_a/\1 file://site_b//(.*) http://host_b/\1
Very handy - works like a charm. Thank you for posting.
Watoh
March 4, 2012, 10:16am
7
[quote="leo"]e.g.
Clipboard COPYNAMES=url REGEXP (ftp|file)://ftp\.mysite\.org//(.*) http://www.mysite.org/\2
and you can give more than one find & replace pair:
Clipboard COPYNAMES=url REGEXP file://site_a//(.*) http://host_a/\1 file://site_b//(.*) http://host_b/\1 [/quote]
I'm being thick and don't really understand all this.
This button would be very handy for me..
Clipboard COPYNAMES=url REGEXP (ftp://|file:///)(.*)//(.*) http://\2/\3
returns = http://ftp.djow.co.uk/djow/bitsbobs/test.JPG
I'd like help altering it so it returns = http://www.djow.co.uk/bitsbobs/test.JPG
Can someone please help be alter this command line.. (i'm really clueless on them!)
Thanks
Watoh
March 4, 2012, 10:19am
8
^^ Sorry thought this thread was in the help section.. opps move if needed please
Leo
March 4, 2012, 10:36am
9
[quote="Watoh"]Clipboard COPYNAMES=url REGEXP (ftp://|file :///)(.)//(. ) http://\2/\3
returns = http://ftp.djow.co.uk/djow/bitsbobs/test.JPG
I'd like help altering it so it returns = http://www.djow.co.uk/bitsbobs/test.JPG [/quote]
Try this:
Clipboard COPYNAMES=url REGEXP (ftp://|file:///)ftp\.(.*)//(.*) http://www.\2/\3
Watoh
March 4, 2012, 10:51am
10
Thanks Leo..
that returns = http://www.djow.co.uk/djow/bitsbobs/test.JPG
I need it on omit the extra djow so it returns = http://www.djow.co.uk/bitsbobs/test.JPG
Thanks, i really appreciate the help.
Leo
March 4, 2012, 10:57am
11
Clipboard COPYNAMES=url REGEXP (ftp://|file:///)ftp\.djow\.co\.uk//djow/(.*) http://www.djow.co.uk/\2
I think. Something like that.
Watoh
March 4, 2012, 1:23pm
12
Perfect leo..that works perfectly, that is such a damn useful button for me
Nige
September 7, 2013, 2:35pm
13
Hi Could I be cheeky?
To save opening another thread, could someone help with ftp>http for:
ftp://ftp .{subdomain.domain.yada}//htdocs/generic-folder/filename.filetype
With htdocs removed from the string.
Many thanks.