Hi all,
I’m working with Photoshop script and I’m rather puzzled at an error.
I used the script listener plugin that comes with Photoshop. It’s basically a macro recorder that generates code from user actions.
Anyway I used it to record me saving a DDS file so I could use the code with a custom script I’ve written. But it doesn’t work. When I run the script I get the error
Error 25: Expected: ;.
Line: 198
-> var idNVIDIAthreeD/DDS = stringIDToTypeID( “NVIDIA D3D/DDS” );
I’ve checked the code and all lines end with semi colon.
Also I’ve ran the code as a .js and .jsx and it doesn’t work with either type
Any help would be much appreciated
Here’s all the code
// =======================================================
var idsave = charIDToTypeID( "save" );
var desc5 = new ActionDescriptor();
var idAs = charIDToTypeID( "As " );
var desc6 = new ActionDescriptor();
var idbarF = charIDToTypeID( "barF" );
desc6.putBoolean( idbarF, true );
var idfdev = charIDToTypeID( "fdev" );
desc6.putDouble( idfdev, 3.000000 );
var idfbia = charIDToTypeID( "fbia" );
desc6.putDouble( idfbia, 0.000000 );
var idurad = charIDToTypeID( "urad" );
desc6.putDouble( idurad, 5.000000 );
var iduamo = charIDToTypeID( "uamo" );
desc6.putDouble( iduamo, 0.500000 );
var iduthr = charIDToTypeID( "uthr" );
desc6.putDouble( iduthr, 0.000000 );
var idxstf = charIDToTypeID( "xstf" );
desc6.putDouble( idxstf, 1.000000 );
var idxthf = charIDToTypeID( "xthf" );
desc6.putDouble( idxthf, 1.000000 );
var idqual = charIDToTypeID( "qual" );
desc6.putInteger( idqual, 71 );
var iderdi = charIDToTypeID( "erdi" );
desc6.putBoolean( iderdi, false );
var iderdw = charIDToTypeID( "erdw" );
desc6.putInteger( iderdw, 1 );
var idusfa = charIDToTypeID( "usfa" );
desc6.putBoolean( idusfa, false );
var idtxfm = charIDToTypeID( "txfm" );
desc6.putInteger( idtxfm, 1 );
var idweig = charIDToTypeID( "weig" );
desc6.putInteger( idweig, 0 );
var idtmty = charIDToTypeID( "tmty" );
desc6.putInteger( idtmty, 0 );
var idmmty = charIDToTypeID( "mmty" );
desc6.putInteger( idmmty, 30 );
var idsmip = charIDToTypeID( "smip" );
desc6.putInteger( idsmip, 0 );
var idbina = charIDToTypeID( "bina" );
desc6.putBoolean( idbina, false );
var idprem = charIDToTypeID( "prem" );
desc6.putBoolean( idprem, false );
var idfilm = charIDToTypeID( "film" );
desc6.putBoolean( idfilm, false );
var idalpb = charIDToTypeID( "alpb" );
desc6.putBoolean( idalpb, false );
var idbord = charIDToTypeID( "bord" );
desc6.putBoolean( idbord, false );
var idbrdr = charIDToTypeID( "brdr" );
desc6.putDouble( idbrdr, 0.000000 );
var idbrdg = charIDToTypeID( "brdg" );
desc6.putDouble( idbrdg, 0.000000 );
var idbrdb = charIDToTypeID( "brdb" );
desc6.putDouble( idbrdb, 0.000000 );
var idmmft = charIDToTypeID( "mmft" );
desc6.putInteger( idmmft, 2 );
var idfdcl = charIDToTypeID( "fdcl" );
desc6.putBoolean( idfdcl, false );
var idfdaf = charIDToTypeID( "fdaf" );
desc6.putBoolean( idfdaf, false );
var idftworl = charIDToTypeID( "f2rl" );
desc6.putDouble( idftworl, 0.500000 );
var idftwogl = charIDToTypeID( "f2gl" );
desc6.putDouble( idftwogl, 0.500000 );
var idftwobl = charIDToTypeID( "f2bl" );
desc6.putDouble( idftwobl, 0.500000 );
var idftwoal = charIDToTypeID( "f2al" );
desc6.putDouble( idftwoal, 0.500000 );
var idfddl = charIDToTypeID( "fddl" );
desc6.putInteger( idfddl, 0 );
var idfafm = charIDToTypeID( "fafm" );
desc6.putDouble( idfafm, 0.150000 );
var idbafh = charIDToTypeID( "bafh" );
desc6.putDouble( idbafh, 0.500000 );
var iddthc = charIDToTypeID( "dthc" );
desc6.putBoolean( iddthc, false );
var iddthzero = charIDToTypeID( "dth0" );
desc6.putBoolean( iddthzero, false );
var idsmth = charIDToTypeID( "smth" );
desc6.putInteger( idsmth, 0 );
var idfilg = charIDToTypeID( "filg" );
desc6.putDouble( idfilg, 2.200000 );
var idfieg = charIDToTypeID( "fieg" );
desc6.putBoolean( idfieg, false );
var idfilw = charIDToTypeID( "filw" );
desc6.putDouble( idfilw, 10.000000 );
var idover = charIDToTypeID( "over" );
desc6.putBoolean( idover, false );
var idfblr = charIDToTypeID( "fblr" );
desc6.putDouble( idfblr, 1.000000 );
var idnmcv = charIDToTypeID( "nmcv" );
desc6.putBoolean( idnmcv, false );
var idncnv = charIDToTypeID( "ncnv" );
desc6.putInteger( idncnv, 1009 );
var idnflt = charIDToTypeID( "nflt" );
desc6.putInteger( idnflt, 1040 );
var idnmal = charIDToTypeID( "nmal" );
desc6.putInteger( idnmal, 1034 );
var idnmbr = charIDToTypeID( "nmbr" );
desc6.putBoolean( idnmbr, false );
var idnmix = charIDToTypeID( "nmix" );
desc6.putBoolean( idnmix, false );
var idnmiy = charIDToTypeID( "nmiy" );
desc6.putBoolean( idnmiy, false );
var idnmiz = charIDToTypeID( "nmiz" );
desc6.putBoolean( idnmiz, false );
var idnmah = charIDToTypeID( "nmah" );
desc6.putBoolean( idnmah, false );
var idnswp = charIDToTypeID( "nswp" );
desc6.putBoolean( idnswp, false );
var idnmsc = charIDToTypeID( "nmsc" );
desc6.putDouble( idnmsc, 100.000000 );
var idnmnz = charIDToTypeID( "nmnz" );
desc6.putInteger( idnmnz, 0 );
var idusbi = charIDToTypeID( "usbi" );
desc6.putBoolean( idusbi, false );
var idlien = charIDToTypeID( "lien" );
desc6.putBoolean( idlien, false );
var idshdi = charIDToTypeID( "shdi" );
desc6.putBoolean( idshdi, false );
var idshfi = charIDToTypeID( "shfi" );
desc6.putBoolean( idshfi, false );
var idshmm = charIDToTypeID( "shmm" );
desc6.putBoolean( idshmm, true );
var idshan = charIDToTypeID( "shan" );
desc6.putBoolean( idshan, true );
var idclrc = charIDToTypeID( "clrc" );
desc6.putInteger( idclrc, 0 );
var idvdxone = charIDToTypeID( "vdx1" );
desc6.putBoolean( idvdxone, true );
var idvdxtwo = charIDToTypeID( "vdx2" );
desc6.putBoolean( idvdxtwo, true );
var idvdxthree = charIDToTypeID( "vdx3" );
desc6.putBoolean( idvdxthree, true );
var idvdxfive = charIDToTypeID( "vdx5" );
desc6.putBoolean( idvdxfive, true );
var idvfourfourfour = charIDToTypeID( "v444" );
desc6.putBoolean( idvfourfourfour, true );
var idvfivefivefive = charIDToTypeID( "v555" );
desc6.putBoolean( idvfivefivefive, true );
var idvfivesixfive = charIDToTypeID( "v565" );
desc6.putBoolean( idvfivesixfive, true );
var idveighteighteight = charIDToTypeID( "v888" );
desc6.putBoolean( idveighteighteight, true );
var idalph = charIDToTypeID( "alph" );
desc6.putBoolean( idalph, false );
var idusra = charIDToTypeID( "usra" );
desc6.putBoolean( idusra, false );
var idusfs = charIDToTypeID( "usfs" );
desc6.putInteger( idusfs, 0 );
var idprev = charIDToTypeID( "prev" );
desc6.putBoolean( idprev, false );
var idrdep = charIDToTypeID( "rdep" );
desc6.putInteger( idrdep, 3000 );
var idlomm = charIDToTypeID( "lomm" );
desc6.putBoolean( idlomm, false );
var idsflp = charIDToTypeID( "sflp" );
desc6.putBoolean( idsflp, false );
var idlflp = charIDToTypeID( "lflp" );
desc6.putBoolean( idlflp, false );
var idscar = charIDToTypeID( "scar" );
desc6.putDouble( idscar, 1.000000 );
var idscag = charIDToTypeID( "scag" );
desc6.putDouble( idscag, 1.000000 );
var idscab = charIDToTypeID( "scab" );
desc6.putDouble( idscab, 1.000000 );
var idscaa = charIDToTypeID( "scaa" );
desc6.putDouble( idscaa, 1.000000 );
var idbiar = charIDToTypeID( "biar" );
desc6.putDouble( idbiar, 0.000000 );
var idbiag = charIDToTypeID( "biag" );
desc6.putDouble( idbiag, 0.000000 );
var idbiab = charIDToTypeID( "biab" );
desc6.putDouble( idbiab, 0.000000 );
var idbiaa = charIDToTypeID( "biaa" );
desc6.putDouble( idbiaa, 0.000000 );
var idsiar = charIDToTypeID( "siar" );
desc6.putDouble( idsiar, 1.000000 );
var idsiag = charIDToTypeID( "siag" );
desc6.putDouble( idsiag, 1.000000 );
var idsiab = charIDToTypeID( "siab" );
desc6.putDouble( idsiab, 1.000000 );
var idsiaa = charIDToTypeID( "siaa" );
desc6.putDouble( idsiaa, 1.000000 );
var idbiir = charIDToTypeID( "biir" );
desc6.putDouble( idbiir, 0.000000 );
var idbiig = charIDToTypeID( "biig" );
desc6.putDouble( idbiig, 0.000000 );
var idbiib = charIDToTypeID( "biib" );
desc6.putDouble( idbiib, 0.000000 );
var idbiia = charIDToTypeID( "biia" );
desc6.putDouble( idbiia, 0.000000 );
var idoutw = charIDToTypeID( "outw" );
desc6.putBoolean( idoutw, false );
var idclcL = charIDToTypeID( "clcL" );
desc6.putBoolean( idclcL, true );
var idNVIDIADthreeD/DDS = stringIDToTypeID( "NVIDIA D3D/DDS" );
desc5.putObject( idAs, idNVIDIADthreeD/DDS, desc6 );
var idIn = charIDToTypeID( "In " );
desc5.putPath( idIn, new File( "C:\\DEV\\Scripts\\Textures\\Alpha Textures" ) );
executeAction( idsave, desc5, DialogModes.NO );