Packed script have different behavior than script folder

Post Reply
freakpazo
Newbie
Posts: 9
Joined: Fri Nov 03, 2023 3:46 pm

Packed script have different behavior than script folder

Post by freakpazo »

Hello,

I am building a script that is reading/writing metadata with exiftool. I am using exiftool-vendored npm package to interact with exiftool.

When I am using my script folder everything works fine.
I am packing the script with "SwitchScriptTool --pack *source* *destination* --password *password*".
The script is packed successfully but when I try to use it in a flow as soon as I try to interact with exiftool inside the script I am getting the following error - "Process stopped unexpectedly". Try catch blocks can't handle the error either.

Note: Under windows both the script folder and the packed script works fine. Under Mac the script folder works fine while the packed script throws the error.
freddyp
Advanced member
Posts: 1078
Joined: Thu Feb 09, 2012 3:53 pm

Re: Packed script have different behavior than script folder

Post by freddyp »

There are npm packages that do a postprocessing after installation, usually to build something. This build process is of course dependent on the operating system. So when you install the package on Windows and it builds correctly it will work on Windows, and if you do the same on Mac it will work on Mac, but copying a script folder/packed script from one operating system to the other will of course not work.

Based on what you describe I guess that you copied the script folder from Windows to Mac. When you install the packages again they will build if required and it works. If you copy the packed script from Windows to Mac it does not work, but if you were to pack the working script folder on Mac it would also work on Mac.
freakpazo
Newbie
Posts: 9
Joined: Fri Nov 03, 2023 3:46 pm

Re: Packed script have different behavior than script folder

Post by freakpazo »

I do not transfer the script. It is inside a repo.
I clone the repo on mac then build it and run it on mac as a "script folder". It works fine. As soon as I pack it using SwitchScriptTool to a single .sscript file and I try to run it this way it starts to throw the error and not work properly.
The error is thrown as soon as I try to interact with exiftool
Post Reply