I want to use XYplorer as a library cataloging program

Features wanted...
highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: I want to use XYplorer as a library cataloging program

Post by highend »

1. Use my script to convert your tag.dat file (use the semicolon in the input dialog)
2. Apply the tweak (and ofc use the semicolon as the delimiter)
3. Add your tags inside XY as necessary...
One of my scripts helped you out? Please donate via Paypal

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

Re: I want to use XYplorer as a library cataloging program

Post by Ryan »

highend wrote:1. Use my script to convert your tag.dat file (use the semicolon in the input dialog)
2. Apply the tweak (and ofc use the semicolon as the delimiter)
3. Add your tags inside XY as necessary...
So, this will allow me to have a tag such as the one below without having the comma delimit the tag into two separate tags?

"Surnames, Jewish—Lists and Histories"

?

admin
Site Admin
Posts: 64917
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: I want to use XYplorer as a library cataloging program

Post by admin »

To put it this way: yes.

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

Re: I want to use XYplorer as a library cataloging program

Post by Ryan »

Ryan wrote:
highend wrote:1. Use my script to convert your tag.dat file (use the semicolon in the input dialog)
2. Apply the tweak (and ofc use the semicolon as the delimiter)
3. Add your tags inside XY as necessary...
Ok, I have the tag.dat file open in Notepad... Where do I insert your script within that file?

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: I want to use XYplorer as a library cataloging program

Post by highend »

Ok, I have the tag.dat file open in Notepad... Where do I insert your script within that file?
It's a script, not something that is pasted into an .ini file...

Menu - Scripting - Run Script

Paste my script into that box and hit ok.
One of my scripts helped you out? Please donate via Paypal

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: I want to use XYplorer as a library cataloging program

Post by bdeshi »

Hey, wait. You should run this script. It's a modified version of highend's original script with a few fixes, or rather, updates.
HOWTOUSE: From XY main menu, select Scripting > Run Script. copy and paste this script code there, then press OK. Then follow direction that pop up.

Code: Select all

//rewrites tag database with modified tag separator at ini\Settings\TagsSeparator
//--changes from highend's original --
// some invisible handholding, updated disallowed separators list, reopens inputbox in case of invalid input,
// and most importantly, set the new tweak!  :wink: 
    savesettings;
    $tagFile = "<xydata>\tag.dat";
    $tagFileContent = readfile($tagFile);
    $tagFileHeader  = gettoken($tagFileContent, 1, "Data:<crlf>");
    $tagFileTags    = gettoken($tagFileContent, 2, "Data:<crlf>");

    $tagFileVer = regexreplace($tagFileContent, "(XYplorer File Tags v)(\d+)", "$2");
    if ($tagFileVer < 3) { status "tag.dat file must be of version 3 (or later), aborted!", "8B4513", "stop"; end 1==1; }
    $delim = '';
    while ((strlen($delim)!=1) || (regexmatches($delim, "(\|\<|\>|\*|\?)"))){
        $delim = input("Type new tag delimiter here", "Only single character delimiters are possible.<crlf>'<>|*?' are not allowed!", , , , 250, 150);
        if (regexmatches($delim, "(\|\<|\>|\*|\?)")) { status "$delim is not allowed as a replacement delimiter!", "8B4513", "stop"; }
        if (strlen($delim) > 1) { status "The delimiter can only be a SINGLE character!", "8B4513", "stop"; }
    }

    $newTags = "";
    foreach($entry, $tagFileTags, "<crlf>") {
        if !($entry) { continue; }
        $tags = gettoken($entry, 3, "|");
        if ($tags) {
            $newTags = $newTags . regexreplace($entry, "^(.*?\|\d+\|)([^\|]*)(.*(?=$))", "$1" . replace($tags, ",", $delim) . "$3") . "<crlf>";
        } else { $newTags = $newTags . $entry . "<crlf>"; }
    }
    if (confirm("Write the converted tag.dat file back?<crlf 2>(Advice: press OK)")) {
        writefile($tagFile, $tagFileHeader . "Data:<crlf>" . $newTags);
    }
    setkey $delim, 'TagsSeparator', 'Settings';
    echo "XYplorer will automagically restart now, don't worry.",' ',,0;
    exit 'nr';
edit: hotfixed a regexp mismatch!
edit: now it explicitly points out where to enter the delimiter

Remember to close that Notepad window you'd opened earlier without saving any changes to tag.dat
Also remember to separate newly added tags with the new separator that you're gong to pick.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

Re: I want to use XYplorer as a library cataloging program

Post by Ryan »

Ok... Getting closer.

Where in the script do I specify my desired semicolon delimiter?

I appreciate both of you staying with me on this.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: I want to use XYplorer as a library cataloging program

Post by bdeshi »

HOWTOUSE: From XY main menu, select Scripting > Run Script. copy and paste this script code there, then press OK. Then follow directions that pop up.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: I want to use XYplorer as a library cataloging program

Post by highend »

1. Use my script to convert your tag.dat file (use the semicolon in the input dialog)
Sorry, this is getting ridiculous...
One of my scripts helped you out? Please donate via Paypal

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

Re: I want to use XYplorer as a library cataloging program

Post by Ryan »

Look, I don't have the expertise in this that the rest of you apparently have. I am trying to understand your instructions but you are assuming that I know my way around a procedure like this but I simply do not! "Use my script to convert your tag.dat file (use the semicolon in the input dialog)"... WHERE IS THE INPUT DIALOGUE??? I don't know where to put the semicolon.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: I want to use XYplorer as a library cataloging program

Post by bdeshi »

temper, temper.
Just follow my instructions up ^there^.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Linkaday
Posts: 386
Joined: 06 Aug 2007 14:40
Location: Hamburg, Germany - Win 11 Home v24H2 x64 1920x1080 (100%)

Re: I want to use XYplorer as a library cataloging program

Post by Linkaday »

HTH
Attachments
DelimiterInput.jpg
DelimiterInput.jpg (507.81 KiB) Viewed 3616 times

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

Re: I want to use XYplorer as a library cataloging program

Post by Ryan »

Hi Linkaday,

You are very kind - thank you. When I get to step 4, the popup says "Convert tag delimiter" rather than "Type new tag delimiter here." I type the semicolon in the field, hit enter, and the next popup says "Write the converted tag.dat file back?" I select ok, but that seems to cancel the process rather than to execute it.

I am running the trial version of the program: Is that what is preventing me from making progress?

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: I want to use XYplorer as a library cataloging program

Post by highend »

I select ok, but that seems to cancel the process rather than to execute it.
Why does it seem so, did you take a look at the rewritten tag.dat?
Is that what is preventing me from making progress?
No.
One of my scripts helped you out? Please donate via Paypal

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

Re: I want to use XYplorer as a library cataloging program

Post by Ryan »

highend wrote:
I select ok, but that seems to cancel the process rather than to execute it.
Why does it seem so, did you take a look at the rewritten tag.dat?
Is that what is preventing me from making progress?
No.
It seems to cancel the process because this is what I type for tags:

Surnames, Jewish—Lists and Histories;
Jewish Identities

But this is what the new script turns that into:

Jewish Identities; Jewish—Lists and Histories; Surnames

My opinion is that the script is simply replacing the comma with a semicolon and breaking up the script the same way, only with a different delimiter.

Post Reply