[solved] Using script to rename file, then tag file, will not update the tag.data file

Things you’d like to miss in the future...
Post Reply
wenmin92
Posts: 24
Joined: 26 Dec 2020 12:25

[solved] Using script to rename file, then tag file, will not update the tag.data file

Post by wenmin92 »

Using script to rename file, then tag file, even if the "Save changes to disk immediately" was checked, the tag.data file will not update the tag. And, the following separete tag operation will all fail(could not update the tag.data fiile), even if it is for other files.
If I want to force update(write) the tag.data file, I have to click "save settings" menu or exit XYplorer.
For example:

Code: Select all

"test1"
  $file = get('SelectedItemsPathNames');
  $file = renameitem('temp01.txt', $file); // work
  tagitems('tag', 'test1', $file); // not work

// it's ok
"test2"
  $file = get('SelectedItemsPathNames');
  tagitems('tag', 'test2', $file);
  $file = renameitem('temp02.txt', $file);

// test1, then test3, not work
// test2, then test3, it's ok
"test3"
  $file = get('SelectedItemsPathNames');
  tagitems('tag', 'test3', $file);
Last edited by wenmin92 on 10 Jun 2021 16:35, edited 1 time in total.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Using script to rename file, then tag file, will not update the tag.data file

Post by highend »

No, when you want to save the tag database after scripts have modified something you don't need to click on anything, you let the script do the job^^

savesettings 64;

E.g.:

Code: Select all

  $file = get('SelectedItemsPathNames');
  $file = renameitem('temp01.txt', $file);
  tagitems('tag', 'test1', $file);
  savesettings 64;
Which works fine here...
One of my scripts helped you out? Please donate via Paypal

wenmin92
Posts: 24
Joined: 26 Dec 2020 12:25

Re: Using script to rename file, then tag file, will not update the tag.data file

Post by wenmin92 »

highend wrote: 10 Jun 2021 16:25 No, when you want to save the tag database after scripts have modified something you don't need to click on anything, you let the script do the job^^

savesettings 64;

Which works fine here...
Oh, I forgot to search the api doc to find a way to save settings. Thanks.

Post Reply