Open Illustrator in Photoshop

Post Reply
pcarvalho
Newbie
Posts: 16
Joined: Tue Dec 16, 2014 12:08 pm

Open Illustrator in Photoshop

Post by pcarvalho »

I made a script to open illustrator Eps in Photoshop, but i get the error: Script returned error: ERROR: TypeError: null is not an object

What am i doing wrong?
Can any one help me?

Here's the script:

if($error == null)
{
try
{
var epsOpts = new EPSOpenOptions();
epsOpts.antiAlias = true;
epsOpts.mode = OpenDocumentMode.CMYK;
epsOpts.resolution = 72;
epsOpts.constrainProportions = true;
epsOpts.width = new UnitValue(1024, 'px' );//alterado de 1280 para 1024

var infile = $infile;
open(infile,epsOpts);
}
catch(theError)
{
$error = theError;
}
}

$error
loicaigon
Member
Posts: 147
Joined: Wed Jul 10, 2013 10:22 am

Re: Open Illustrator in Photoshop

Post by loicaigon »

I think you need to instantiate a File Object in the ExtendScript context :

var infile = File ( String ( $infile ) );
if ( infile.exists )…

It's probably a type mismatch.

Loic
http://www.ozalto.com
pcarvalho
Newbie
Posts: 16
Joined: Tue Dec 16, 2014 12:08 pm

Re: Open Illustrator in Photoshop

Post by pcarvalho »

Worked just fine.
Thank you.
Post Reply