• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
17

P: SDK: catalog:triggerImportUI() doesn't open Import with the supplied path on Windows

LEGEND ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

On Windows, the method catalog:triggerImportUI (path) opens the Import window but doesn't set the initial source to "path". It works correctly on Mac.

 

To reproduce on LR 13.0.1 / Windows 11:

 

1. Save this script to the file "test-import.lua":

 

local path = import "LrPathUtils".getStandardFilePath ("home")
import "LrDialogs".message (path)
local catalog = import "LrApplication".activeCatalog()
catalog:triggerImportUI (path)

 

 

2. In LR, do Scripts > Open User Scripts Folder and place "test-import.lua" in that folder.

 

3. Restart LR.

 

4. Do Scripts > test-import and observe that the Import window opens but no source is selected in the Source panel.  The Windows 11 result is on the left, Mac OS 14.1 on the right:

 

johnrellis_0-1700611316691.png  johnrellis_2-1700611504799.png

 

 

Bug Fixed
TOPICS
macOS , SDK , Windows

Views

529

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Pinned Replies

Adobe Employee , Nov 22, 2023 Nov 22, 2023

I've opened a ticket for this issue, John. Thanks for your report. 

Status Investigating

Votes

Translate

Translate
Adobe Employee , Jan 04, 2024 Jan 04, 2024

Per @johnrellis  comment - marking as fixed (can no longer reproduce)

Status Fixed

Votes

Translate

Translate
13 Comments
Community Beginner ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

In a simple UrlHandler.lua script, I would like the import to select a default directory.

The script initiates an import, but no directory is selected.

 

path = 'D:\\DNG Import';

local application = import 'LrApplication';
local catalog = application.activeCatalog();
catalog:triggerImportUI( path );

 

Lightroom Classic-versie: 13.0.1
Besturingssysteem: Windows 10 - Business Edition
Versie: 10.0.19045
Toepassingsarchitectuur: x64
Systeemarchitectuur: x64

Votes

Translate

Translate

Report

Report
LEGEND ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

It works correctly on Mac but not Windows. I just filed a bug report:

https://community.adobe.com/t5/lightroom-classic-bugs/sdk-catalog-triggerimportui-doesn-t-open-impor...

Votes

Translate

Translate

Report

Report
LEGEND ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Nov 22, 2023 Nov 22, 2023

Copy link to clipboard

Copied

I've opened a ticket for this issue, John. Thanks for your report. 

Rikk Flohr - Customer Advocacy: Adobe Photography Products
Status Investigating

Votes

Translate

Translate

Report

Report
Community Beginner ,
Nov 22, 2023 Nov 22, 2023

Copy link to clipboard

Copied

Thanks!

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jan 03, 2024 Jan 03, 2024

Copy link to clipboard

Copied

John,

We couldn't repro this issue on a Win 10 or a Win 11 machine.
The Import window opens the correct folder after running the script.
Are we missing something?

 

Thanks,

Sunil

Votes

Translate

Translate

Report

Report
LEGEND ,
Jan 03, 2024 Jan 03, 2024

Copy link to clipboard

Copied

The issue doesn't occur in my LR 13.1 / Windows 11 (though it does with LR 13.0.1).  So I guess we can close this issue.

Votes

Translate

Translate

Report

Report
Community Beginner ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

The mentioned script is my default workflow script, but it still doesn't function with version 3.1.

 

That could be, because my path parameter isn't formatted properly:

path = 'D:\\DNG Import';

Before posting the issue I did tried many ways of supplying a static path, but for testing I would like to know the correct way for sure.

 

It might be that this one has at least worked in the past:

path = 'D:/DNG Import';

 

Thanks in advance!

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

Per @johnrellis  comment - marking as fixed (can no longer reproduce)

Rikk Flohr - Customer Advocacy: Adobe Photography Products
Status Fixed

Votes

Translate

Translate

Report

Report
Community Beginner ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

As said, for me it still doesn't function correctly. After a bit of testing I found out that under the following circumstances it doesn't select a directory: 

  • A memory card is plugged in, or
  • The url handler is activated and Lightroom wasn't running already

Votes

Translate

Translate

Report

Report
LEGEND ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

@Martijn26765361ihg7, in my testing, both forward slashes and backslashes are accepted by triggerImportUI(). Many but not all parts of LR accept forward slashes on Windows. But backslashes always work.

 

However, I did notice that case is significant in the path provided to catalog:triggerImportUI().  If the case doesn't match exactly the case of the path stored in the file system, LR won't recognize it.  For example, if Windows File Explorer shows the case as "D:\DNG Import", then LR won't recognize the path "D:\DNG import".

 

I also noticed that URL handlers don't work correctly when LR isn't running. My Any Filter plugin generates CSV files with "lightroom:" hyperlinks that select particular photos in LR. But when LR isn't started, clicking the link in Excel causes LR to start and go to the Import window with no source selected (even though the handler doesn't call triggerImportUI()).  This may be the same misbehavior striking you, and if so, the bug is unrelated to triggerImportUI().

 

I recommend you post a new bug-report thread with a complete standalone plugin with the minimal source code needed to demonstrate the possible URL handler bug (everything else stripped out), with precise step-by-steps for reproducing the URL handler problem. Upload the plugin to Dropbox, Google Drive, or similar and post the sharing link here.  The simpler the test plugin (i.e. no extraneous code), the more likely Adobe will be able to reproduce the bug and prioritize a fix.

 

 

Votes

Translate

Translate

Report

Report
Community Beginner ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

@johnrellis Thanks for your extensive reaction. 

In a way funny that my url handling script, was not executed at all in my circumstance (not a running LR process), but close enough to have some expectation that it was. That part I can fix by starting a LR process myself.

 

About case sensitivity,  the paths where the same CS. (But it shouldn't be needed imo)

 

So the bug provoking circumstance of a mounted memory card remains. 

 

Hope that will be solved somedays..

Votes

Translate

Translate

Report

Report
LEGEND ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

LATEST

"About case sensitivity,  the paths where the same CS. (But it shouldn't be needed imo)"

 

LR has always treated paths as case-sensitive, even though by default the file systems of volumes on Mac and Windows are case-insensitive. However, both Mac and Windows support case-sensitive volumes, and Adobe decided long ago that LR supports such volumes. But LR's implementation doesn't check the volume of paths when comparing them to decide whether to use case, and I highly doubt Adobe will ever correct LR to do so.

Votes

Translate

Translate

Report

Report