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

Include another file into a .psjs script

New Here ,
Mar 09, 2025 Mar 09, 2025

Copy link to clipboard

Copied

Hi,

Is it possible to include/require another file in a .psjs script?

I'm not talking about a plugin, but a stand-alone .psjs script.

If not, I believe this is possible with plugins?

Can I put a script in a plugin and use it without an UI interface, that is, use the plugin just like a script?

 

Thanks in advance,

Erik.

TOPICS
Actions and scripting

Views

70
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
Adobe
Engaged ,
Mar 09, 2025 Mar 09, 2025

Copy link to clipboard

Copied

Non credo di aver capito bene la domanda.

 

Purtroppo la traduzione è un po' confusa.

 

Non puoi usare un'azione per chiamare il file psjs?

O vuoi un pannello con pulsanti che chiami il file psjs?

Se potessi essere più chiaro, sarò felice di aiutarti.

Votes

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 ,
Mar 09, 2025 Mar 09, 2025

Copy link to clipboard

Copied

@erikbongers Have you tried throught the Script Events Manager?

creativeexplorer_0-1741516922866.png

 

Votes

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 ,
Mar 09, 2025 Mar 09, 2025

Copy link to clipboard

Copied

LATEST

UXP Script (psjs) can import external files in CommonJS format.

// main.psjs

const { alert } = require('./external.js') ;
alert('hello') ;
// external.js

const { app } = require('photoshop') ;

const alert = async (message) => {
  await app.showAlert(message) ;
} ;

module.exports = {
  alert
} ;

 

In UXP Plugin, you can develop a plugin without panel by specifying command in the entrypoints of manifest.json and not specifying panel.

Votes

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