Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

applescript error I don't understand why its occuring

$
0
0

Im writing a script that will convert photos from color to black and white. I wrote it at home on cs 5.1 and it worked flawlessly, but when I took it to work on a cs6 version it went buggy. again the code below works on 5.1 but when run at work  it gets into the photoshop handler convertpics() errors.

It errors on change mode line. when run i get the word mode highlighted snd "Expected end of line, etc. but found identifier." it (also) doesn't seem to like the use of Document 1 or current document.in the other lines? Is it how I/m writing it that the dictionary/synatax has changed. ( i couldn't find ant difference). This one is racing my brain because to me it makes no scene. HELP!

 

globalpicfolder

globalorigimages

 

tellapplication "Finder"

setmyhometo (path tohome folder) asstring

setpicfoldertomyhome& "Documents:Dark Side:"

 

if (exists (folderpicfolder)) then

movePics(picfolder) ofme

else

makenewfolderatmyhome& "Documents" with properties {name:"Dark Side"}

endif

setmyPathto (path tohome folder) asstring

 

endtell

-------------------test to see if files are already there------------------------------------

-------------------test to make sure original files still are there---------------------------

onmovePics(picfolder)

tellapplication "Adobe InDesign CS5.5"

telldocument 1

setlinkListtofile pathoflinks

repeatwithlinknumberfrom 1 tocountoflinkList

setdocimagetoitemlinknumberoflinkList

tellapplication "Finder"

copyfiledocimagetofolderpicfolder

endtell

endrepeat

endtell

convertpics(picfolder) ofme

endtell

endmovePics

 

onconvertpics(picfolder)

tellapplication "Finder" tosetorigimagestofilesofentire contentsoffolderpicfolder

repeatwithiinorigimages

setoneImagetoiasstring

tellapplication "Adobe Photoshop CS5.1"

openfileoneImage

change modeofdocument 1 tograyscale

setfnametonameofcurrent documentasstring

setmyFiletopicfolder& fname& "_BW"

savecurrent documentinfilemyFileasTIFFwith options {byte order:Mac OS, embed color profile:false, image compression:LZW, save alpha channels:false, save layers:false} appendinglowercase extension

closecurrent documentwithoutsaving

endtell

 

endrepeat

endconvertpics


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>