Code for copying GPS metadata doesn't work anymore

The code lxp kindly provided seems to not work anymore in the latest beta. I get some "unknown error" when i try to copy the metadata. It used to work a couple of days ago. That's strange.

function OnClick(clickData) {
    var cmd = clickData.func.command;
    var tab = clickData.func.sourcetab;
    cmd.deselect = false;

    if (tab.selected_files.count == 0) return;

    var fileMeta = tab.selected_files(0).metadata;
    if (fileMeta != 'image') return;

    var lat = fileMeta.image.latitude;
    var lon = fileMeta.image.longitude;
    var alt = fileMeta.image.altitude;

    if (typeof lat != 'number') lat = 0;
    if (typeof lon != 'number') lon = 0;
    if (typeof alt != 'number') alt = 0;

    DOpus.Vars.Set('lat') = lat;
    DOpus.Vars.Set('lon') = lon;
    DOpus.Vars.Set('alt') = alt;
    DOpus.Vars.Set('gpsStatusBar') = lat.toFixed(1) + '/' + lon.toFixed(1) + '/' + alt.toFixed(1); // {var:glob:gpsStatusBar}

Works ok here.

I think i have found the reason. At first i had noticed, that after copying images over to some test folder all EXIF data was lost. Only the file name and size were preserved. All other data, including coordinates were gone. Then i had a look into my scripts preferences, finding Steve's Photo Exif and (i think) Full Screen Metaedit highlighted in red. Once i turned off Photo Exif, i was able to copy the correct data to another test folder, with all metadata being complete. Then i reactivated Photo Exif, and now it works again. That's strange, and i had another test edit on some images using the full screen edit, which i think is belonging to Tagger, but couldn't reproduce the effect. Photo Exif works fine, too. I have no idea, how this conflict happened, but now there are no more red highlighs on the script modules anymore. I'm also aware, that one script is in vbs, while the other one uses js. I don't know, if this may be a possible reason, but i had to make a Windows restore from my imaging program, and the next day i updated to Windows 10 version 2004 :smiley:

I can't speak for the other scripts you mention, but PhotoExif does nothing which would affect the copying of files, whether it's enabled, disabled or broken in your scripts list. Unless the PhotoExif dialog is showing it's inactive and even then it's just reading the source folder for changes in file selection.

Just experimented and with PhotoExif enabled or disabled or even actually running in the background all metadata copies correctly.

Like i said, that was very strange. I agree, there should be no interaction whatsoever regarding copying stuff. I suspect something else going on here (see my other post), but i can't figure out, what exactly happened. The last scripts i used a couple of hours ago wer all related to the Tagger, to which Full Screen Metaedit belongs, plus a couple more. And after i turned back on Photo Exif, no red came up, and the other one (the red highlight on Full Screen Metaedit) was gone, too, so something must have caused it in the background, recently. Because i had used Opus without problems for weeks, with no issues along that line.

:thinking: