Skip to main content
Participant
May 1, 2020
Answered

trying to create an illustrator script to create new document, but can't set the doc profile

  • May 1, 2020
  • 3 replies
  • 1618 views

hi,

I am trying to create an illustrator script to create a new document, but I want it to use one of my new document profiles, ie. Print, Web, etc.

I found this (below), but cannot seem to set it in the document, any ideas?

 

Parameter Type Description

presetType       

DocumentPresetType:
DocumentPresetType.Print
DocumentPresetType.Web
DocumentPresetType.Mobile
DocumentPresetType.Video
DocumentPresetType.BasicCMYK
DocumentPresetType.BasicRGB

  
This topic has been closed for replies.
Correct answer renél80416020

Salut!

Moi j'utilise:

var doc = documents.addDocument("Vidéo et Film",app.getPresetSettings("Vidéo et Film"));

ou
var index = 11;
var doc = documents.addDocument(startupPresetsList[index],app.getPresetSettings(startupPresetsList[index]))

 

var presetsList = [];
  for (i = 0; i < startupPresetsList.length; i++) {
    presetsList[i] = [i,startupPresetsList[i]];
  }
  alert("Repèrez bien l'index !!\r\r"+presetsList.join('\r'));
var index = prompt("Index presetlist",0);
  alert("Votre choix: "+presetsList[index][1]);

var doc = documents.addDocument(presetsList[index][1],app.getPresetSettings(presetsList[index][1]));

 

 

 

3 replies

renél80416020
renél80416020Correct answer
Inspiring
May 1, 2020

Salut!

Moi j'utilise:

var doc = documents.addDocument("Vidéo et Film",app.getPresetSettings("Vidéo et Film"));

ou
var index = 11;
var doc = documents.addDocument(startupPresetsList[index],app.getPresetSettings(startupPresetsList[index]))

 

var presetsList = [];
  for (i = 0; i < startupPresetsList.length; i++) {
    presetsList[i] = [i,startupPresetsList[i]];
  }
  alert("Repèrez bien l'index !!\r\r"+presetsList.join('\r'));
var index = prompt("Index presetlist",0);
  alert("Votre choix: "+presetsList[index][1]);

var doc = documents.addDocument(presetsList[index][1],app.getPresetSettings(presetsList[index][1]));

 

 

 

Community Expert
May 1, 2020

The description of addDocument method is as follows

app.documents.addDocument(startupPreset [, presetSettings] [, showOptionsDialog])

Parameter Type Description
startupPreset String Startup preset to use
presetSettings DocumentPreset, optional Preset document template
showOptionsDialog Boolean, optional Whether to show options dialog

 

-Manan

 

-Manan
CarlosCanto
Community Expert
Community Expert
May 1, 2020

use the below command

app.documents.addDocument('Web');