appyface Posted November 16, 2009 Report Share Posted November 16, 2009 The Ketarin doc states that {file} may only be used in commands, and that seems to be true. But it also appears that functions cannot be used in commands? Hmmm.... I have a command script to be executed after every file downloaded to disk. I need to pass two parameters to it: The full path/filename of the downloaded file, and a slightly modified string created from that same path/filename. This is the command line I want to use: script.bat {file} d:\newdir1\newdir2{file:replace:d:\oldpathdir\:\} assuming {file} = d:\oldpathdir\node2\node3\somefilename.ext the above command line would pass the two parameters exactly as I want: Parameter1: d:\oldpathdir\node2\node3\somefilename.ext Parameter2: d:\newdir1\newdir2\node2\node3\somefilename.ext Unfortunately, this commandline is submitted by Ketarin as this: script.bat d:\oldpathdir\node2\node3\somefilename.ext d:\newdir1\newdir2{file:replace:d:\oldpathdir\:\} As mentioned above, I can't use {file} in Ketarin variables. I tried! (And I wish I could, I have MANY uses for it). So what I want to do doesn't seem possible at the moment? Or is it, and I'm just not seeing it...? Thanks in advance for any help. Regards, --appyface Link to comment Share on other sites More sharing options...
floele Posted November 17, 2009 Report Share Posted November 17, 2009 You need to be careful with the colons. Should work better: {file:replace:d\:\\oldpathdir\\:\\} Link to comment Share on other sites More sharing options...
appyface Posted November 17, 2009 Author Report Share Posted November 17, 2009 Thanks Flo! Ah yes I should have seen my : characters would need extra treatment since they are delimiters. Why do I need to escape the \ character also? This is not a regexreplace, just plain ol' replace, yes? TIA, --appyface Link to comment Share on other sites More sharing options...
floele Posted November 18, 2009 Report Share Posted November 18, 2009 Yep, but it's usual that you have to or can escape the escape character itself. 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