illwill Posted September 22, 2010 Report Share Posted September 22, 2010 (edited) the variable doesnt seem to work anymore :/ needed it to get the filename of the .rar I was downloading so I could rename the folder "DrvBK2_1.rar" is the file name so i just want "DrvBK2_1" log is this E:\Repair>ren E:\Repair\Backup\{url:basefile} DriverBackup2 The filename, directory name, or volume label syntax is incorrect. also new beta version doesn't resize the "execute the following commands after downloading" editbox when you drag the corner to resize the window, the top window "execute the following commands before downloading" works though Edited September 22, 2010 by illwill Link to comment Share on other sites More sharing options...
floele Posted September 22, 2010 Report Share Posted September 22, 2010 You cannot use it in commands, as it requires a reference to the URL which is only available during download (variables for example). You might want to use {file:whateverfunction} instead. Link to comment Share on other sites More sharing options...
Ash Bishop Posted March 18, 2012 Report Share Posted March 18, 2012 Is there any variable to extract exactly file name? For example: http://miranda.googlecode.com/files/miranda-im-v0.9.46-unicode.7z And variable like {file:name} so there would be "miranda-im-v0.9.46-unicode" instead of variable? Link to comment Share on other sites More sharing options...
shawn Posted March 19, 2012 Report Share Posted March 19, 2012 Ash, you can use "{file}" if the path & name is all you want. If you want only the filename use {file:filename} More here: http://wiki.ketarin.org/index.php/Functions Link to comment Share on other sites More sharing options...
Ash Bishop Posted March 20, 2012 Report Share Posted March 20, 2012 Yes, I read that before but I mean only a file name. {file:filename} - Returns the file name (with extension) from a file path. I thought maybe there is an option to extract without extension. Link to comment Share on other sites More sharing options...
shawn Posted March 25, 2012 Report Share Posted March 25, 2012 One option for that is to capture {url:basefile} to your own custom variable, then utilize that variable within your command. Link to comment Share on other sites More sharing options...
floele Posted March 25, 2012 Report Share Posted March 25, 2012 I'll add a "filenameWithoutExtension" function to the next version of Ketarin. Link to comment Share on other sites More sharing options...
Ash Bishop Posted March 25, 2012 Report Share Posted March 25, 2012 One option for that is to capture {url:basefile} to your own custom variable, then utilize that variable within your command. Thank you for temporary solution. Now I'm just renaming app and using {appname} instead. I'll add a "filenameWithoutExtension" function to the next version of Ketarin. Thank you. It would be great. Link to comment Share on other sites More sharing options...
Guest Dji Posted November 30, 2012 Report Share Posted November 30, 2012 I got an issue using {url:basefile} in my custom variables and "Save in Folder". I would like to use part of the downloaded file name into the "Save in folder" field using part of url basefile (because the filename or the url basefile is the only location where the application version is, none web page displays it (for information the application is CopyTrans Manager) So here are my custom variables: url : http://fr.copytrans....php?program=CTM ddl_basefile : {url:basefile} version : {ddl_basefile:regexreplace:.*(\d+(?:\.\d+)+)\.\w+$:$1} And "Save in folder" is : ..\Download\{name}\{version}\ But this not works, the folder name remains ..\Download\CopyTransManager Help would be appreciated, Thanks ! Link to comment Share on other sites More sharing options...
Dji Posted November 30, 2012 Report Share Posted November 30, 2012 Hum, sorry for not be signed for my first post ;-) I would like to precise I also tried using {file} instead of {url:basefile} but without success... Again, thanks in advance for any help ! :-) Link to comment Share on other sites More sharing options...
shawn Posted December 1, 2012 Report Share Posted December 1, 2012 {url:basefile} is what you want, but I don't think you can assign it to a variable since the {url} variable depends on the other variables already being processed. Instead of using {ddl_basefile:regexreplace:.*(\d+(?:\.\d+)+)\.\w+$:$1} - have you tried with just {url:basefile} in the foldername? Link to comment Share on other sites More sharing options...
Dji Posted December 2, 2012 Report Share Posted December 2, 2012 Problem is that I need to get version number from filename in order to save it into a dedicated folder (which include the version number) and the issue is that the version number is displayed nowhere on the website, only in the downloaded filename. Link to comment Share on other sites More sharing options...
shawn Posted December 2, 2012 Report Share Posted December 2, 2012 I understand that, but this would at least be the first diagnostic step to determine what's going on. Have you tried it yet? Link to comment Share on other sites More sharing options...
Dji Posted December 3, 2012 Report Share Posted December 3, 2012 Using {url:basefile} in "Save in folder" field, the variable is evaluated. So if I understood well, there is no solution for my issue for now :-( Am i right ? Link to comment Share on other sites More sharing options...
shawn Posted December 3, 2012 Report Share Posted December 3, 2012 Not a direct solution (download to a folder named the version number which isn't exposed until you download it), but you could use a post-download script to effect the same thing. For example, pass the {url:basefile} into batch, which would then do something like this (trial and error will be necessary to get it right): SET fOLD={url:basefile} SET fNEW=%FOLD:CopyTransManagerFRv=% pushd "..\Download\{name}\" mv "%fOLD%" "%fNEW%" I don't recall if batch is now processed sequentially or not (it's been a while), but you can execute this all as one command with: SET fOLD={url:basefile}&& SET fNEW=%FOLD:CopyTransManagerFRv=%&& pushd "..\Download\{name}\"&& mv "%fOLD%" "%fNEW%" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now