Page 1 of 1

TWS file format

Posted: Sun Jun 30, 2024 8:51 am
by IanOfYork
Please consider converting the workspace control files to an open format.
Either change the format to XML, publish the file spec or provide a utility to list the embedded information.
An XML format would allow us to edit the file list when a directory is renamed.

Re: TWS file format

Posted: Thu Jul 11, 2024 12:56 pm
by bbadmin
TextPad's workspace files are saved in the most compact and fastest format possible.

The path to document file names is stored relative to the folder containing the WSP file (unless they are above it or in a different path). Hence, you can move the whole directory tree to another location and the files in the workspace can still be opened.

If you use the File/Rename command to move a file to a new location, that change will be saved in the workspace.

Unfortunately, this does not help if you rename a directory or file outside of TextPad.

Re: TWS file format

Posted: Thu Jul 11, 2024 3:46 pm
by ben_josephs
I posted a Python script that lists the names of the document files in a workspace file here:
viewtopic.php?p=45822#p45822

Re: TWS file format

Posted: Thu Jul 11, 2024 5:36 pm
by IanOfYork
You did indeed, for which I thank you.
I also have a (rather less concise) PHP script that I used to study the TWS format and which can also output the file list.

I am just thinking that it would be nicer if the TWS file was editable.

If I rename a project that is referenced in one or more TWS files, then loading one of those TWS files causes TextPad to silently remove the (now invalid) references.

Perhaps a "cheaper" option would be a once-only (copyable) message that lists the "lost" files.

Re: TWS file format

Posted: Fri Jul 12, 2024 4:33 pm
by bbadmin
Not directly applicable, but in case you're not aware, the Edit/Copy Other/All File Names command will place the fully qualified names of all the files currently open on the clipboard.

Also, if you paste and save them in a file, say wspfiles.txt, then use the Quick Open command (Ctrl+Shift+O) to open it as "@wspfiles.txt", all the files in it will be opened instead. You can also use an @-file as a runtime parameter when starting TextPad.