param(
[Parameter(Mandatory = $true,Position = 0)][string]$Filename
)
$PAGE_SIZE = 5000
$server="localhost"
$port="50519"
$protokoll="http"
$URI="$($protokoll)://$($server):$($port)"
$fileNames = @(get-content $Filename)
$windowName = (gci "$fileName").BaseName
$Match=@()
$PAGE = 0
# Write-Host -Object "Login in WebService"
$authenticate = Invoke-RestMethod -Uri "$URI/v1/authenticate" -Method Post -Body @{'id' = $env:USERNAME; 'password' = ''; 'appid' = '' }
$auth_token = $authenticate.auth_token
# Write-Host -Object "Login with Token $($auth_token)"
while ($true) {
$result=Invoke-RestMethod -Uri "$URI/v1/files" -Method GET -Body @{'page' = $PAGE; 'pagesize' = $PAGE_SIZE; 'fields' = 'id,filename';'auth_token' = $auth_token}
foreach($file in $result.files){
foreach($name in $fileNames){
if($file.fileName.ToLower() -eq $name.ToLower()){
$Match+=$file.ID
break;
}
}
}
if($result.files.length -lt $PAGE_SIZE){break}
$PAGE++
# Write-Host -Object "Page $PAGE"
}
Invoke-RestMethod -Method Post -Uri "$URI/v1/imatch/resultwindow/open" -Body @{'name' = "$windowName"; 'id' = $($Match -join ",");'auth_token' = $auth_token}
Quote from: Mees Dekker on July 21, 2024, 08:32:34 AMI import all my latest pictures into IMatch, rename them, do some culling, add geo information and categories (I don't use keywords) and only after that I start developing the selected files.
Quote from: philburton on July 21, 2024, 07:06:34 AMMaybe I should have said, only one program at a time can save XMPs. If Lightroom is being used, and is saving XMPs, then I guess that iMatch should be "just watching."
Quote from: RobiWan on July 17, 2024, 08:39:25 AMQuote from: philburton on July 17, 2024, 01:54:18 AMAnd I know that iMatch and Lightroom can't be running at the same time.Why not? I have very often both applications running and I don't see any problems.
Only the one point can be maybe important - deactivate immediately writing Metadata (XMP files) in LR.