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

Include another file into a .psjs script

New Here ,
Mar 09, 2025 Mar 09, 2025

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

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.

Translate
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

@erikbongers Have you tried throught the Script Events Manager?

creativeexplorer_0-1741516922866.png

 

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

Translate
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