New native variable = <curitempath>
Posted: 07 May 2009 22:41
Here's a scenario:
Let's say I have a file called abc.txt and it's located in C:\B\, but I don't know that it's there.
I navigate to C:\ and hit Ctrl+F. Type in *.txt (because I don't know the exact name of my text file either, just a rough idea) and leave the other options as default. Click Search and it finds a handful in C:\, including the one I want. Now I have a script I want to apply on this file. Here it is: As it turns out, the output of that script is written to C:\ and not C:\B\. While the former is technically correct from the point of view of being <curpath>, it's the latter that may be more desirable. In this case it is, I want to convert a file from one type to another, but for result of conversion to be in the same folder as source. Therefore, a native variable called <curitempath> (basically path to <curitem>) should be introduced so scripts can be applied to files paths of which are relative to files on which scripts are applied.
This is particularly useful when applying different scripts to individual files in search results window, especially since navigating to a folder where a particular file is, applying a script and clicking "Back" doesn't return you to the page with search results.
Unless they can be applied that way already without leaving the search results window, can they?
Let's say I have a file called abc.txt and it's located in C:\B\, but I don't know that it's there.
I navigate to C:\ and hit Ctrl+F. Type in *.txt (because I don't know the exact name of my text file either, just a rough idea) and leave the other options as default. Click Search and it finds a handful in C:\, including the one I want. Now I have a script I want to apply on this file. Here it is:
Code: Select all
regexreplace $data, readfile("<curitem>"), "\n", "<crlf>"; writefile("<curpath>\<curbase>.nfo", "$data");This is particularly useful when applying different scripts to individual files in search results window, especially since navigating to a folder where a particular file is, applying a script and clicking "Back" doesn't return you to the page with search results.
Unless they can be applied that way already without leaving the search results window, can they?