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

How to set my path

Participant ,
Aug 28, 2013 Aug 28, 2013

I would like to include a script in a script... but this won't work please help.

var loadvars = File(app.path+'/Infopanel/Contents/Vars/vars.jsx');

#include loadvars

Thanks Daniel

TOPICS
Scripting
714
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
Engaged ,
Aug 28, 2013 Aug 28, 2013

You haven't included a lot of information, but perhaps you could include it in the same script as a function and call it when you need it.

info on using functions\/

http://www.codecademy.com/courses/javascript-beginner-en-6LzGd?curriculum_id=506324b3a7dffd00020bf66...

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
Guru ,
Aug 28, 2013 Aug 28, 2013
LATEST

See Preprocessor Directives in the Toolkit Guide… The #include wants a file name string not a File Object.

I think it will default to Folder Current ( where the calling script is ) otherwise you will need to specify relative path using #includepath

#target illustrator

#include 'myScriptName.jsx'

//#includepath 'aRelativePath'

testMyExternalFunctions( 'muppet' );

#target illustrator

function testMyExternalFunctions( mess ) {

   

    alert( mess );

   

};

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