Forum > Windows
[Closed] How to find active folder path?
Zvoni:
If you've already processed "something" successfully in earlier steps, just save the last path in a variable?
loaded:
I am currently doing map work and dealing with satellite view and other technical details of each parcel. And all these details are saved in the folder belonging to the parcel. For example, today I had to deal with 136 folders. So there is no fixed file path.
Guys, I'm done for now. He is no longer in a hurry, if there is an improvement, it will be beneficial for the future. For your information. Respects.
GetMem:
@loaded
Try something like this:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type TfMain = class(TForm) procedure FormCreate(Sender: TObject); private FScreenShotDir: String; public end; //... procedure TfMain.FormCreate(Sender: TObject);begin FScreenShotDir := GetAppConfigDir(False) + 'ScreenShots\'; if not DirectoryExists(FScreenShotDir) then if not ForceDirectories(FScreenShotDir) then FScreenShotDir := GetTempDir(False) + 'ScreenShots\'end;
Now you have a base screenshot directory. The path on windows typically looks like this: C:\Users\%USERNAME%\AppData\Local\%YOURPROJECTNAME%\ScreenShots\. The method works on other platforms too. When needed, you can create subfolders for parcels, like this:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- SubDir := FScreenShotDir + 'parcel1\'; if CreateDir(SubDir) then SaveScreenhotToFile(SubDir + 'photo.png')
loaded:
GetMem, Thank you for the number of characters you wrote.
Most of the time, I work in the form of saving to a certain folder as you describe. Then I distribute it to the relevant folders manually.
But now things started to increase, and this process began to be painful.
I need to solve this problem directly at its source, in the folder it is related to.
In the meantime, something occurred to me;
To add to the menu that comes with the right click in the folder view.
I sailed the sails and diverted the course in this direction. Respects.
nouzi:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- caption := '-'
Navigation
[0] Message Index
[#] Next page
[*] Previous page