EDOBE XDOM EM Spécifications Page 50

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 231
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 49
Adobe Photoshop CS6
JavaScript Scripting Reference JavaScript Object Reference 50
Application sample scripts
Application.jsx
This script invokes an alert box to display Properties important to an application such as version number,
the path to the application, the amount of memory available, and the number of documents open.
When a user presses the OK button on the alert box, a second dialog opens, which asks users whether they
would like the foreground and background colors set for the document presently open. If no document is
open, the script opens a new document for the user.
The script (with no document open) produces a progression of three dialogs.
//Create a Welcome message
// Use the name and version properties of the application object to
// Append the application’s name and version to the Welcome message
// use "\r" to insert a carriage return
// use the combination operator += to append info to the message
var message = "Welcome to " + app.name
message += " version " + app.version + "\r\r"
// find out where Adobe Photoshop CS6 is installed
// and add the path to the message
// add the optional parameter fsName to the path property
// to display the file system name in the most common format
message += "I’m installed in " + app.path.fsName + "\r\r"
// see how much memory Adobe Photoshop CS6 has to play with
message += "You have this much memory available for Adobe Photoshop CS6: " +
app.freeMemory + "\r\r"
// use the length property of the documents object to
// see how many documents are open
var documentsOpen = app.documents.length
message += "You currently have " + documentsOpen + " document(s) open.\r\r"
// display the message to the user
alert(message)
// answer will be true for a "Yes" answer and false for a "No" answer
var answer = confirm("Set the foreground and background to my favorite colors?")
showColorPicker
()
boolean
Returns false if dialog is cancelled,
true otherwise.
stringIDToTypeID
(stringID)
string
number
Converts from a string ID to a runtime
ID.
togglePalettes
()
Toggle palette visibility.
typeIDToCharID
(typeID)
number
string
Converts from a runtime ID to a
character ID.
typeIDToStringID
(typeID)
number
string
Converts from a runtime ID to a string
ID.
Method Parameter type Returns What it does (Continued)
Vue de la page 49
1 2 ... 45 46 47 48 49 50 51 52 53 54 55 ... 230 231

Commentaires sur ces manuels

Pas de commentaire