Wow. Thanks Mark! I'll test and get back to you.  

Looking at it you deal with the tricky issue of how to identify the latest 
download version in a possible mass of files. 

I manged to do it with a batch file but for only one wiki. I think 
powershell  is a better equipped way to go than batch. Assume, later, it 
can be invoked from batch, if needed. 

Best wishes
Josiah

On Monday, 20 May 2019 23:41:19 UTC+2, Mark S. wrote:
>
> I'm not a PowerShell aficionado, so even a short script takes some time. 
> If you're feeling daring, and have *backups*, you can try.
>
> At the top of the script is a list of your file stem names. They should 
> match the capitalization of your real files because sometimes Windows gets 
> confused.
>
> The second list is the list of the directories those respective stems go 
> in. There should be a one-to-one correlation. Maybe tomorrow I will learn 
> how to split out file name/paths so that two lists are not necessary ;-)
>
> There's a variable that sets how many seconds to wait before checking the 
> files again. I have it set to 10 seconds.
>
> To launch, open a powershell, go to the downloads directory used by your 
> browser, which should also be where you put the script, and type 
> ./launch_all_tw.ps1 <enter>
>
> To launch from a regular batch file would take a magic invocation, so 
> that's why I'm starting with the powershell.
>
> I had to add a kludge factor of 1 second to get the datestamp to compare 
> correctly. Possibly this would mean that if you did two rapid-fire changes 
> in a row, the 2nd one might not be picked up. But I don't know. It might be 
> fine.
>
> A script for Linux would be similar, but need completely different code.
>  
> -- Mark
>
>
>
>
> # File Stem names. Capitalize per actual file name.
> # Stem must be absolutely unique! Otherwise it might detect wrong file.
> $stemlist = @("notes","Todo")
>
> # List of target directories in same order as stem names
> $dirlist = @("D:\data\Wikis\notes","D:\data\TW2014")
>
> # How many seconds to wait before checking again.
> $waitSeconds = 10
>
> #-- SOURCE DIRECTORY -- NOT USED YET ----------
> $downloaddir = "C:\Users\Mark\Downloads"
>
>
> while(1) {
>     for($i=0;$i -lt $stemlist.Length; $i++) {
>       $stem = $stemlist[$i]
>       $stem
>       $dir = $dirlist[$i]
>       #$dir
>       $copyme = ls $stem*.html | sort LastWriteTime | select -last 1
>       $copyme = $copyme.FullName
>       #$copyme
>       $destination = Get-Item  "$dir\$stem.html"
>       $source = Get-Item "$copyme" 
>       #echo Source: $source.LastWriteTime
>       #echo Destination: $destination.LastWriteTime 
>       If($source.LastWriteTime -gt $destination.LastWriteTime.addSeconds(1
> ) ) {
>       #echo "Source: " $source.LastWriteTime "greater than " 
> $destination.LastWriteTime.addSeconds(1) 
>         Copy-Item $copyme -Destination "$dir\$stem.html"
>         echo "Copying $copyme to $dir\$stem.html"
>       } Else {
>         echo "Will not be copying"
>       }
>     }
>     echo "Going to sleep..."
>     start-sleep -seconds $waitSeconds 
> }
>
>
>
>
>
>
> On Monday, May 20, 2019 at 6:05:35 AM UTC-7, @TiddlyTweeter wrote:
>>
>> At the moment, on modern browsers, saving TW without any custom saver, 
>> means the save ends up in "Downloads".
>>
>> We have no tool to "auto resurrect" and copy back that save for those 
>> kinds of saves. Copying back has to be manual and can get complicated in a 
>> forest of downloads.
>>
>> The more I think about this the more odd it seems.
>>
>> I mean, with an "AUTO-RESTORE" from saves in Download to a wiki directory 
>> ANY browser could be used and with ANY version of TW. We would not be 
>> dependent on specific solutions.
>>
>> Any thoughts on how to do this? And its probable value?
>>
>> I know Mark S. has thought about it.
>>
>> Best wishes
>> Josiah
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fb27e5fe-fa1e-4fba-a982-3883e298c57b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to