Skip to main content
Participant
March 30, 2008
Question

newbie: Running terminal commands?

  • March 30, 2008
  • 1 reply
  • 636 views
Hi everybody!

I'm kinda newbie (truly this's first time I ever tried javascripting) to Adobe Javascript. I'm trying to use Script Events to run a script on launch of Photoshop. This script should do this: run a terminal command
b "defaults write com.apple.Dock autohide -bool YES; killall -HOP Dock" .
Can anyone help me with this? I found a line
b "system( "commandLineStuff" );"
, but I don't know how to use this in ExtendScript Toolkit 2.

Thanks
This topic has been closed for replies.

1 reply

Participant
June 18, 2008
With a bat file ?

// define your bat file
var bat = new File("C:/Program Files/Adobe/Adobe Photoshop CS2/Paramètres prédéfinis/Scripts/simple_viewer/SimpleW.bat");

// run SimpleW.bat file
bat.execute();
Known Participant
June 18, 2008
alain_filiol@adobeforums.com wrote:
> With a bat file ?
>
> // define your bat file
> var bat = new File("C:/Program Files/Adobe/Adobe Photoshop CS2/Paramètres prédéfinis/Scripts/simple_viewer/SimpleW.bat");
>
> // run SimpleW.bat file
> bat.execute();

On a Mac, it's slightly different. You have to create a Unix-style shell script.
It also has to be created before it's called by File.execute because you have to
make it executable (e.g. chmod 755 scriptName.sh).

Be sure to test it on the command line before trying to run it from PS.

-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com