Logout Developer Knowledgebase Search Adobe Partners Main Adobe Solution Partner Finder Adobe Solution Partner Program Support Developer Knowledgebase Adobe Solution Partner Program Products & Technology Adobe
Developer Knowledgebase

Knowledgebase HomeGoLive KB

Overview
Software Development Kits
Developer Knowledgebase
Support
Legal Notices
Feedback
Adobe Solution Partner Program
Join
Find a Solution Partner

Product
GoLive
 
Version
6.0
 
Last Edited
04-Nov-2003
 
Document
52504

How To: Access to the command line from Extend Script

Summary
Extend Script offers command line access on Windows and Mac OS X.


Issue
Can I access the Window's command line from my Extend Script?

Solution
There is a previously undocumented function:
   system( "commandLineStuff" );

This function calls the command line on Windows and the Shell on Mac OS X. It doesn't work on Mac OS 9 since there's no Shell or command line.

To create a binary you can use any compiler which creates a dll for Windows or a CFM library for OS X. You can't call a Mach-O library on OS X. (That would be possible if you wrote a little bridge from CFM to Mac-O.)

Windows Examples
You can enter the code below into the "command" line of the GoLive JavaScript shell window. The resulting file will be found in the directory represented by app.currentFolder. By default on Windows, this is the folder where GoLive is installed.
   system("dir > dirList.txt")

You can change app.currentFolder to another folder using the File Object Constructor.
   app.currentFolder = JSXFile("file://C:/Program Files/Adobe/FrameMaker7.0/")

You can then launch an application in that folder with:
   system("framemaker.exe")

Note: Golive will be locked up as long as the Command Prompt window is open. You'll have to close the Command Prompt window manually.


Mac OS X Example
On OSX if you don't specify directories, the directory being listed is the root directory and the generated file will be found at root.
   system("ls > list.txt")

You can select other existing directories using:
   system("ls /etc > /tmp/list.txt")

To launch a CFM application use:
   system("open -a '/Applications/Acrobat Reader 5.0'")

To launch bundled applications use:
   system("open -a '/Applications/Chess.app'")

(Use Show Info > Name & Extension, or a Terminal window to see if the File System Name includes a ".app" extension.)

Result
The return value is always the return value of the executed command.
result = 0 typically indicates success.


back to top
Was this Knowledgebase document helpful? Yes  No
The articles in this knowledgebase are intended for use by software programmers currently using an Adobe SDK to extend or customize an Adobe product. These articles may be highly technical in nature.
If you have questions about an Adobe Product that are not related to development or an SDK product please visit: http://adobe.com/support/main.html
Copyright © Adobe Systems Incorporated. All rights reserved.
Terms of Use
Online Privacy Policy