I'm trying to write a script that can handle folder names. I'll explain.
I have a lot of HTML files that were saved and are connected with their folders.
And I need to process them in a manner that their style files are called by their folders, like this:
Current call:
<link media="all" href="index.css" type="text/css" rel="stylesheet">
Desired call:
<link media="all" href="SubFolderBelow/index.css" type="text/css" rel="stylesheet">
Current HTML file of the above example is in SubFolderBelow and it will be moved to an upper folder later, after processing.
So CopyFilePath from macro commands is: C:\CurrentFolder\SubFolderBelow\CurrentFile.html
That is the same folder of index.css: C:\CurrentFolder\SubFolderBelow\index.css
I did a search here at the forum and found some information about this issue. But, till now, I can't find a way to achieve my goal.
I found a very detailed and extensive script written by Mofi and other related topics:
So far, I can see that this job is better done with a script than a macro, I think.
Unfortunately, I spent too much time on try and error tasks without success.
To use regular expressions from this topic, I could not truncate the full file path as desired.
Solution is at scripts capabilities for sure.
But it seems to be beyond my skills...
![🙁](https://cdn.jsdelivr.net/gh/s9e/emoji-assets-twemoji@11.2/dist/svgz/1f641.svgz)
So, my choice is to ask for help here.
This is the main question, but it would be very nice if I could run some script that Find/Replace href=" tag by href="SubFolderBelow/
AND
such script could run that Find/Replace on all HTML files that are at subfolders below C:\CurrentFolder.
I have a lot of HTML files that were saved and are connected with their folders.
And I need to process them in a manner that their style files are called by their folders, like this:
Current call:
<link media="all" href="index.css" type="text/css" rel="stylesheet">
Desired call:
<link media="all" href="SubFolderBelow/index.css" type="text/css" rel="stylesheet">
Current HTML file of the above example is in SubFolderBelow and it will be moved to an upper folder later, after processing.
So CopyFilePath from macro commands is: C:\CurrentFolder\SubFolderBelow\CurrentFile.html
That is the same folder of index.css: C:\CurrentFolder\SubFolderBelow\index.css
I did a search here at the forum and found some information about this issue. But, till now, I can't find a way to achieve my goal.
I found a very detailed and extensive script written by Mofi and other related topics:
So far, I can see that this job is better done with a script than a macro, I think.
Unfortunately, I spent too much time on try and error tasks without success.
To use regular expressions from this topic, I could not truncate the full file path as desired.
Solution is at scripts capabilities for sure.
But it seems to be beyond my skills...
So, my choice is to ask for help here.
This is the main question, but it would be very nice if I could run some script that Find/Replace href=" tag by href="SubFolderBelow/
AND
such script could run that Find/Replace on all HTML files that are at subfolders below C:\CurrentFolder.