Who can write script for me (and maybe others)?

RobiWan
Posts: 114
Joined: 03 Nov 17 9:14

Who can write script for me (and maybe others)?

Post by RobiWan » 25 Jul 18 16:37

Hi guys,

I would like use Canon DPP RAW converter with PSU. But this is not possible - see https://forum.idimager.com/viewtopic.php?f=57&t=27192

Is there anyone here who can write PascalScript for PSU? I need something urgently and unfortunately have absolutely no idea about PascalScript

What do I need.
- A collection should be created (example -'To Edit')
- A directory on the hard disk (example -'To Edit')
(This can be done manually)

I'm putting pictures into this collection. When I'm done, I start the script and it goes there and creates hardlinks on the disk from the images from the collection to the directory "To Edit".

When I'm done, I can delete the images from the collection and from the "To Edit" directory.

Hert
Posts: 5973
Joined: 13 Sep 03 7:24

Re: Who can write script for me (and maybe others)?

Post by Hert » 25 Jul 18 21:23

Not sure what you mean with "hardlinks".

From how you describe it, I would recommend using the Image Basket to collect your images (Shift+B). Then open the Image Basket, select all (Ctrl+A) and press Ctrl+E to export the selected image to a folder. Configure the export not to use Sizing so that the originals are copied
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

RobiWan
Posts: 114
Joined: 03 Nov 17 9:14

Re: Who can write script for me (and maybe others)?

Post by RobiWan » 26 Jul 18 6:11

Hert wrote:
25 Jul 18 21:23
Not sure what you mean with "hardlinks".
OSX (*nix) and Windows know Hardlinks https://en.wikipedia.org/wiki/Hard_link

/Export/Import is no option for me. I don't want to move or copy my images to another place/

Hert
Posts: 5973
Joined: 13 Sep 03 7:24

Re: Who can write script for me (and maybe others)?

Post by Hert » 26 Jul 18 11:40

Perhaps you can write a batch file that creates the hard link for you for a file is passed as its parameter. Then add that batch as a 3rd party application in PSU. Select images, and click the application icon for your batch to create the links.
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

RobiWan
Posts: 114
Joined: 03 Nov 17 9:14

Re: Who can write script for me (and maybe others)?

Post by RobiWan » 26 Jul 18 15:47

Hi Hert,

I will try that. PowerShell or AppleScript is not a big problem for me ;)
But how do I find out which files are in my collection and what the physical path on the hard disk is to it?
First I create a PowerShell script which takes exactly 1 parameter and then creates hardlink for the file. And then we see further

Hert
Posts: 5973
Joined: 13 Sep 03 7:24

Re: Who can write script for me (and maybe others)?

Post by Hert » 26 Jul 18 16:34

Sorry, not one parameter but multiple as multiple selected thumbnails can be passed to the external batch.
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

RobiWan
Posts: 114
Joined: 03 Nov 17 9:14

Re: Who can write script for me (and maybe others)?

Post by RobiWan » 26 Jul 18 17:23

Hi Hert,

well unfortunately it doesn't really work as a 3-rd party tool :(
This is my PowerShell script.

Code: Select all

Param
(
    [Parameter(Mandatory = $true,Position = 0)][String]$file
)
$logPath = "C:\PowerShell\Logs"
$logName = "psu2dpp.log"
$version = "1.0"
$directory = 'c:\temp\DPP'
$executable = 'C:\Windows\SysWOW64\fsutil.exe'
$parameter = 'hardlink create'
$fileName = Split-Path $file -leaf

##########################################
# Function to check Program Return Code
##########################################
function testRC ($RC) {
    if ($Programm.ExitCode -eq 0) {
        Log-Write -LogPath "$logPath\$logName" -LineValue "Hardlink Erstellung am $(Get-Date -format "dd.MM.yyy") war erfolgreich"
        }
    else {
        Log-Write -LogPath "$logPath\$logName" -LineValue "Hardlink Erstellung am $(Get-Date -format "dd.MM.yyy") war nicht erfolgreich"
    }
}
Log-Start -LogPath "$logPath" -LogName "$logName" -ScriptVersion "$version" -NewLog $False
$programm = Start-Process `"$executable`" -Argumentlist "$parameter $directory\$FileName $file" -wait -NoNewWindow -PassThru
testRC $programm

When I insert the *.ps1 file into PSU as an application and want to start it, I get the error message
"failed to execute :193"
with this data:
IDI.v4.ApplicationException

----- details -----

ExceptionTimeStamp=2018-07-26T16:20:21.011Z
ExceptionThreadName=Main Thread
ExceptionClass=EProcess
Exception=Failed to execute : 193
Build=4.2.0.1590
Edition=Single
Architecture=64 bit
CallStack= $000000010030D670 EXECUTE, line 287 of fcl-process/src/win/process.inc
$000000010008D24E RUNAPP, line 5115 of ../../XOM/OMPublic.pas
$000000010025CDEF RUNEXTERNALAPPLICATIONFORIMAGES, line 15761 of ufmain.pas
$000000010025E73D _QLRUNAPPLICATION, line 16137 of ufmain.pas
$00000001001E3962 DOCLICK, line 61730 of ../../XOM/DXscene/dx_vgcore.pas
$00000001001E3DEE CLICK, line 61853 of ../../XOM/DXscene/dx_vgcore.pas
$0000000100162160 CLICK, line 24353 of ../../XOM/DXscene/dx_vgcore.pas
$00000001001E43B9 MOUSEUP, line 61977 of ../../XOM/DXscene/dx_vgcore.pas
$000000010016249B MOUSEUP, line 24416 of ../../XOM/DXscene/dx_vgcore.pas
$00000001001F5976 MOUSEUP, line 67552 of ../../XOM/DXscene/dx_vgcore.pas
$000000010033DD63 DOMOUSEUP, line 2319 of include/control.inc
$000000010033EAA0 WMLBUTTONUP, line 2801 of include/control.inc
$00000001000117C1 DISPATCH, line 674 of ../inc/objpas.inc
$000000010033DB61 WNDPROC, line 2259 of include/control.inc
$0000000100331DA9 WNDPROC, line 5406 of include/wincontrol.inc
$00000001001FC4FA WNDPROC, line 69625 of ../../XOM/DXscene/dx_vgcore.pas
$00000001003E3949 DELIVERMESSAGE, line 112 of lclmessageglue.pas
OperationSystem=Windows 10 64bit (Version: 10.0 build 17134)
Display=3840x2160
AvailableMemory=15,9 GB of 31,9 GB
ProcessorCores=8
Trial=no
UptimeSecs=1829
SystemID=ABA199BBBCC297ABA3B9B6AFA6B17661
DatabaseSystem=SQLite
ActiveCollectionCount=30
I think its because PSU don't know what to do with *.ps1 file. And its not possible to tell PSU my Application is : powershell.exe -f "Path\To\My\Script.ps1"

Hert
Posts: 5973
Joined: 13 Sep 03 7:24

Re: Who can write script for me (and maybe others)?

Post by Hert » 26 Jul 18 17:30

Maybe create a bat file that calls your powershell script?

PSU will start the command that you configure in the Preferences...you could try to set that to you above command to powershell.exe and your script as -f. PSU will pass the selected files as parameters.

If that doesn’t work then I’m out of ideas...
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

RobiWan
Posts: 114
Joined: 03 Nov 17 9:14

Re: Who can write script for me (and maybe others)?

Post by RobiWan » 26 Jul 18 17:48

I'm not sure if we are talking about same thing.
Do you mean this menu? I can select here powershell.exe but I can't give them a parameter like -f "myScript.ps1"
Attachments
26-07-_2018_18-45-02.png
26-07-_2018_18-45-02.png (55.01 KiB) Viewed 1489 times

Hert
Posts: 5973
Joined: 13 Sep 03 7:24

Re: Who can write script for me (and maybe others)?

Post by Hert » 26 Jul 18 18:17

That’s indeed the one I was talking about. If you can’t add parameters then that leaves my origininal reaction to use a bat file
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

RobiWan
Posts: 114
Joined: 03 Nov 17 9:14

Re: Who can write script for me (and maybe others)?

Post by RobiWan » 26 Jul 18 18:26

I'm sorry, I can't do that either. I can write powershell.exe -f "MyScript.ps1" in a cmd but no parameter is passed to the script.

Is it not possible to realize it as PascalScript? Or maybe some other idea

Hert
Posts: 5973
Joined: 13 Sep 03 7:24

Re: Who can write script for me (and maybe others)?

Post by Hert » 26 Jul 18 18:39

most likely that is possible as a script, but you said that you can’t write scripts.

Your bat file should pass on the parameters to the power script if you insist on using powerscript
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

RobiWan
Posts: 114
Joined: 03 Nov 17 9:14

Re: Who can write script for me (and maybe others)?

Post by RobiWan » 26 Jul 18 18:45

Hert wrote:
26 Jul 18 18:39
but you said that you can’t write scripts.
No PascalScript - thats correct. PowerShell, Bash or AppleScript is another thing :D
Hert wrote:
26 Jul 18 18:39
Your bat file should pass on the parameters to the power script if you insist on using powerscript
But it's not. I've tried it

I'll see where I can find something about PascalScript

Hert
Posts: 5973
Joined: 13 Sep 03 7:24

Re: Who can write script for me (and maybe others)?

Post by Hert » 26 Jul 18 18:54

You should let the bat file pass on its parameters. Batches don’t automatically pass on parameters
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

Hert
Posts: 5973
Joined: 13 Sep 03 7:24

Re: Who can write script for me (and maybe others)?

Post by Hert » 26 Jul 18 18:56

And for a script you can use this script as a framework

https://repository.idimager.com/openres ... 5F2FA41269
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

Post Reply