Cannot load Process Icons in startup.scp anymore in PI 1.8.9

MiR

Member
I get the following error message:

Code:
Processing script file: /Applications/PixInsight/etc/startup/startup.scp


*** Error: Signature validation failed for 'core_startup': Invalid code signature: /Applications/PixInsight/etc/startup/startup.scp


* 1 startup script(s) executed.

after modifying startup.scp with this line:

Code:
.open /Users/ring/Documents/PixInsight/DefaultProcessIcons.xpsm

Signature validation kills the cat here, is there a new way to load Preprocess Icons on startup as the startup.scp cannot be edited anymore...
 
Of course this is not a bug, but a logical consequence of the new code security system.

Altering the startup script to load icons has always been nonstandard (and bad) practice. You should consider using template projects, which provide much more flexibility and allow you to configure icons and tools in multiple workspaces. You can also run a custom startup script by executing PixInsight with the --startup-script command line argument:

/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight --startup-script=<file_path>

where <file_path> is the script that you want to run. However, projects are a much better solution.
 
So please tell me how to start PI and immediately load my default icon set in the work space. A specific example of the script to do this would be helpful. My icons are saved as "master_template.xosm". I can load this as a second step after starting PI but why?

Mike Mulcahy
 
looks like you can do the following:

create a text file with the following contents:

Code:
#!/bin/sh 

/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight --startup-script=/Users/mike/master_template.xosm

save the file, and name the file "StartPI.app" or anything, as long as it ends with .app. probably easiest if you save it in your home directory.

i have assumed your OSX username is "mike" and that your template file is in your home directory. you will have to change what i've given above if your username is different or the file is not in your home directory.

open Terminal.app and then type "chmod +x /Users/mike/StartPI.app" without the quotes

now you should be able to double click that icon and it will launch PI with your startup script. if you want, you can drag the icon to the dock. i suppose you can even do a "get info" on PI, copy the blue icon, and then do get info on the script and paste the blue icon to the new 'application'.

rob
 
looks like you can do the following:

create a text file with the following contents:

Code:
#!/bin/sh

/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight --startup-script=/Users/mike/master_template.xosm
Hi Rob,

I just attempted this solution. It failed to load with the following:
Code:
*** Error: *** Error: /Applications/Pixinsight Support Files/default.xosm, line 1: Command not found: ?xml
***

Command was:
Code:
/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight /the/path/to/default.xosm
(Where '/the/path/to/' was, of course, the actual path.)

Any indication what I may have missed, here?

Amusingly
Code:
/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight /the/path/to/default.xosm
Does load the project, but kicks up the following error in PixInsight after launch:
Code:
A project cannot be loaded after other files in a single open command: /the/path/to/default.xosm
 
Of course this is not a bug, but a logical consequence of the new code security system.

Altering the startup script to load icons has always been nonstandard (and bad) practice. You should consider using template projects, which provide much more flexibility and allow you to configure icons and tools in multiple workspaces. You can also run a custom startup script by executing PixInsight with the --startup-script command line argument:

/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight --startup-script=<file_path>

where <file_path> is the script that you want to run. However, projects are a much better solution.
Hi Juan,

In this case, what is the preferred means of loading PixInsight with a default/template project?

May a default project be specified in preferences?

Many of us have workflows which use many routine steps and parameters, as our routine incorporates repetitive camera and telescope combinations, and routine post-processing preferences, and launching PixInsight with some default icons and the like in place is simply practical operation. While manually entering the same settings on a routine basis is wildly inefficient. Opening a default icon set through the startup.scp file was one solution to this problem, so now I'm curious what the next best solution would be.
 
Hi Rob,

I just attempted this solution. It failed to load with the following:
Code:
*** Error: *** Error: /Applications/Pixinsight Support Files/default.xosm, line 1: Command not found: ?xml
***

Command was:
Code:
/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight /the/path/to/default.xosm
(Where '/the/path/to/' was, of course, the actual path.)

Any indication what I may have missed, here?

Amusingly
Code:
/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight /the/path/to/default.xosm
Does load the project, but kicks up the following error in PixInsight after launch:
Code:
A project cannot be loaded after other files in a single open command: /the/path/to/default.xosm

it's the spaces in the filename. you either need to escape them in the script with backslashes like\ as\ shown\ here, or just rename the folder to PixinsightSupportFiles or maybe Pixinsight_Support_Files.

rob
 
it's the spaces in the filename. you either need to escape them in the script with backslashes like\ as\ shown\ here, or just rename the folder to PixinsightSupportFiles or maybe Pixinsight_Support_Files.

rob
Thank you very much, rob. Good eye.

For what it's worth, I did have the spaces escaped in Terminal, but it may well be that it is related to the cause. Next I would have tried launching it from a file path which simply contained no spaces. Instead I've found another solution which will save me the trouble, on macOS, of making further adjustments whenever I want to update the default. Pending any sort of best practice which is suitable.
 
macOS Solution (pending a simple native best practice)

Open Script Editor, and as the sole command, type:
Code:
do shell script "open /path/to/file.ext"

This is AppleScript. The portion in quotes would be the same command you entered in Terminal. If spaces are a part of the path they should be escaped twice "/path/to/folder\\ with\\ spaces/file.ext". The first escape is for Terminal and the second escape is for AppleScript. In this way you can open a .xpsm process icons file, or a project file. By opening that file PixInsight will launch and load the file. Finally, save the script, and under type choose "application," and now you have an app that you can launch in place of PixInsight which will work across updates (provided the file paths for PixInsight or your default file don't change) and which won't require further intervention if you update the file.

- - -

Edit: Here's a small adjustment. This addition to the AppleScript will cause the script to check if PixInsight is running. If it is running, it won't re-load anything, and will just switch focus to PixInsight. If PixInsight isn't running, it will load it with the file specified. This way, when placed in the dock, it behaves more like an application if you click on it again.

Code:
if application "PixInsight" is running then
    tell application "PixInsight"
        activate
    end tell
else
    do shell script "open /path/to/file.ext"
end if
 
Last edited:
On the Mac you can also double-click the .xpsm or .xosm files to have PixInsight load them (or launch and load them). You can also put those into the Dock, for one-click launch and load.
 
If you're a Windows user, you can save your .xpsm icon file to your desktop (it will look similar to a shortcut). Assuming PI is associated with that file type, it will load PI with the icons automatically, when you double click that desktop icon.
 
Last edited:
The responses are very helpful. Clicking on the desktop .xosm file works well. I would prefer a command line argument to load the .xosm file when pixinsight loads. Does anyone know if that is possible?
 
The responses are very helpful. Clicking on the desktop .xosm file works well. I would prefer a command line argument to load the .xosm file when pixinsight loads. Does anyone know if that is possible?

what do you mean by this? both the shell script i posted and the applescript jpeirce posted can open PI with command line arguments.

rob
 
I have reviewed this thread several times and still cannot find a windows solution to load the icons upon opening PI. Clicking on the .xosm file on the desktop works well but I would prefer to load the icons through a command line option in the shortcut. If there is a way to do this could you provide a specific windows example of how to do it.

Sorry to be a bore.
 
ok didn't realize you were talking about Windows. i thought you could specify a whole command line in a windows shortcut? i think @fredvanner has posted an example of this in recent months.

rob
 
Well it turns out to be pretty simple. Right click you PI desktop shortcut, select Properties and in my case change the Target to:

"C:\Program Files\PixInsight\bin\PixInsight.exe" C:/Users/mike/Desktop/master_template.xosm

The icon set is opened when PI is started.

Thanks to all.
 
I set a startup script in a shortcut command (on Win10) - now it looks like: "C:\Program Files\PixInsight\bin\PixInsight.exe" --startup-script=... . It works but it isn't great.
I have PI pin on taskbar. When I start PI, it runs as different program with another icon on taskbar - now I have 2 PI icons on taskbar. Any suggestions?

I tried it also on older laptop with Win7. It works fine - with always only 1 PI on taskbar.
 
Back
Top