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

Difficulty Running .NET Core App in Background on macOS for InDesign Extension

Community Beginner ,
Feb 07, 2024 Feb 07, 2024

Copy link to clipboard

Copied

Hello Adobe Developers community,

 

I’m encountering an issue with an InDesign extension that my team and I have developed. Our extension relies on a .NET Core application to handle HTTPS calls and IDML parsing. While this setup works smoothly on Windows, we’re facing challenges on macOS.

The problem arises because the script responsible for launching the .NET Core DLL waits for the command to finish, preventing it from running in the background. As a result, our extension on macOS isn’t functioning as intended.

 

Attempts Made:

  • We have tried launching the .NET Core DLL using AppleScript and the do shell script command, both with and without methods to run it in the background.

 

Request for Assistance:

We would greatly appreciate any insights, suggestions, or solutions from the community on how to effectively run the .NET Core app in the background on macOS to support our InDesign extension.

 

Additional Details:

  • Operating System: macOS
  • InDesign Version: 16.0, 17.0, 18.0
  • .NET Core Version: 3

 

Thank you in advance for your help and expertise!

TOPICS
Scripting

Views

348

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 1 Correct answer

Community Beginner , Feb 27, 2024 Feb 27, 2024

Thank you again for your continued assistance.

 

To close this, what I did is to compile my .Net Core DLL for osx-x64, used Platypus to create a .app for macOS with no interface, and set it to run in the background without getting the focus from the app it's calling it.

 

These are the links that help someone to do that:

 https://www.xamboy.com/2020/05/28/net-core-application-macos-packaging-and-notarization

https://www.cnet.com/tech/computing/keep-applications-from-stealing-focus-when-opening-in-os-x

...

Votes

Translate

Translate
Community Beginner ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

need to update the Operating System:

macOS Monterey version 12.7.3 (running as a guest in VirtualBox, hosted in a Windows PC)

Votes

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
Community Expert ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

In other words, if you could run do shell script without waiting for a response, would that solve the problem?

 

It might succeed if the following points are taken care of.

  1. Clearly specify the application to tell
  2. Place the tell block in a ignoring application responses block
ignoring application responses
	tell application id "com.adobe.InDesign"
		do shell script your_shell_script
	end tell
end ignoring

 

Votes

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
Community Beginner ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

I tried this but my JSX script still waits for the dll to finish.

 

Attaching JSX (as a picture) and a screenshot when I run it.

As you can observe, InDesign is currently unresponsive. If I forcibly terminate the dotnet process responsible for running ja.dll, the script proceeds as expected, and I receive the 'Done' alert.

 

On Windows, my script initiates the execution of that dll, allowing it to remain active in memory for subsequent use whenever our extension necessitates its functionality.

Votes

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
Community Beginner ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

btw thanks a lot for the quick response.

Votes

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
Community Expert ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

You are running from jsx. It seems doScript is waiting for the results.

 

1. Does it work well to create a single function app that just executes the shell script and then execute it with Folder.execute()?

 

2. Is it possible to use BridgeTalk to execute doScript in a separate thread?

 

3. Have you made sure that doScript and shell script work successfully when executed by just that in the first place?

Votes

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
Community Beginner ,
Feb 12, 2024 Feb 12, 2024

Copy link to clipboard

Copied

Thank you for your continued assistance. I've explored the suggestions provided, but unfortunately, we're still encountering the same issue.

Regarding your suggestions:

1. Tried to execute file but:
                 .jsx files ask for an app to execute them
                 .sh files open xCode simple showing the contents of it
                 .command files run better but the Terminal window is visible so the user can close it and crash the extension 

2. I attempted to use BridgeTalk but it happened the same. InDesign waits for the DLL to close and script hangs up


3. Prior to incorporating these methods, I verified that doScript and the shell script functions successfully when executed independently.

 

Would you have any additional insights or alternative approaches we could explore to effectively run the .NET Core app in the background on macOS?

 

Thank you for your ongoing support.

Votes

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
Community Expert ,
Feb 12, 2024 Feb 12, 2024

Copy link to clipboard

Copied

1.
Is it possible to change the app in charge of processing with "ignoring application responses" or BridgeTalk to another app that is not InDesign? InDesign may be able to proceed at the expense of that app.

 

2.
> doScript and the shell script functions successfully when executed independently
What exactly would be the result of this? Will the DLL keep running and InDesign accept other operations?

 

3.
Can the principal-agent relationship between jsx and .NET Core apps be reversed? That is, the main process is .NET Core app, and jsx is executed from there.

Votes

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
Community Beginner ,
Feb 27, 2024 Feb 27, 2024

Copy link to clipboard

Copied

LATEST

Thank you again for your continued assistance.

 

To close this, what I did is to compile my .Net Core DLL for osx-x64, used Platypus to create a .app for macOS with no interface, and set it to run in the background without getting the focus from the app it's calling it.

 

These are the links that help someone to do that:

 https://www.xamboy.com/2020/05/28/net-core-application-macos-packaging-and-notarization

https://www.cnet.com/tech/computing/keep-applications-from-stealing-focus-when-opening-in-os-x

 

So now that I have an .app I select the file as you proposed and execute it.

 

Thanks again.

Votes

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