This document provides a tutorial on scripting in Adobe InDesign CS3. It introduces the basics of InDesign scripting including what can be done with scripts, how to install and run scripts, and an overview of the different scripting languages (JavaScript, AppleScript, VBScript) that can be used. The document then walks through a simple "Hello World" script example to demonstrate how to create a new document, add a text frame, and enter text. This provides a starting point for learning how to automate tasks and customize InDesign's functionality through scripting.
Steve Jobs said that innovation is what distinguishes a leader from others. Innovation is what allows individuals and companies to stay ahead of the competition. Dreamweaver is a powerful and flexible HTML editor that allows both designers and developers to work efficiently. It provides features for visual editing in Design view as well as powerful code editing capabilities in Code view.
The document provides instructions on how to perform common tasks in Microsoft Word like opening, creating, saving, printing, and closing documents. It explains how to access menus and buttons, enter text, and use features such as word wrap, auto correct, and spell check. Screenshots and step-by-step directions are included to guide users on performing tasks in Word.
How to Design a Logo. User Guide for Logo TemplatesMaxim Logoswish
Learn how to open and use your logo templates.
We provide quality company logo templates for small businesses and individuals, including realtors, bloggers etc. Logoswish deliver modern & creative logos.
Logoswish established their design consultancy in 2001 with a primary focus on logo design and corporate identity. We have experience working with different budget projects. We understand how to provide quality services to our customers through individual attention, and provide satisfaction to each of our clients. Logoswish provide excellent value for money.
General idea of Logoswish provides logo design for small business, individuals (who has personal business activity such as bloggers, photographers, realtors etc.), invents (Expeditions, Forums, meetings etc.) and projects visualization. We specialise in pre-made logo templates to increase both value, but also to shorten the time taken to kick-off a design identity project. Choosing the right logo or corporate design need not be a laborious task. We give you the logo you wish for.
To ensure every customer we provide services for are satisfied, feel they have received excellent value and would recommend us to a colleague or friend.
Logoswish – logos you wish.
http://www.logoswish.com
This document provides an introduction to using Dreamweaver to create websites. It covers setting up a website using Dreamweaver's site management tools, creating pages with text, images, links and tables, and basic HTML editing. The document reviews Dreamweaver's interface including the insert bar, property inspector, and site panel. It also discusses organizing files into folders to structure a website and publishing pages by saving them to the public_html folder.
OpenOffice.org Writer is a free and open-source word processor that is similar to Microsoft Word. It is part of the OpenOffice.org software suite, which also includes spreadsheet, presentation, drawing, formula, and database applications. OpenOffice.org Writer's interface and tools are very similar to Microsoft Word, making it easy for Word users to switch, and it allows documents to be opened and edited in Word format. A key advantage of OpenOffice.org Writer is that it saves files by default in the OpenDocument format, resulting in smaller file sizes than when saved in Word's .doc or .docx formats.
The document provides an overview of the Visual Studio integrated development environment (IDE). It describes popular Visual Studio features like IntelliSense, code cleanup, refactoring, and debugging tools. It also explains how to install Visual Studio, create a simple "Hello World" console app project, add and run code to prompt for a user's name and display a greeting, and view the output in the console window.
This document provides information about scripting in Adobe InDesign 2020, including a summary of InDesign's scripting documentation, directions for running scripts, descriptions of sample scripts included with InDesign, and known issues related to InDesign scripting. It directs readers to InDesign's developer documentation page for additional resources on scripting.
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static types, classes, and interfaces to JavaScript to help catch errors. TypeScript supports object-oriented programming concepts like classes, interfaces, inheritance, and modules. It is compatible with JavaScript and can reuse existing JavaScript code and libraries. The TypeScript compiler checks for errors and compiles TypeScript code into JavaScript that can run on any browser, device, or operating system that supports JavaScript.
Steve Jobs said that innovation is what distinguishes a leader from others. Innovation is what allows individuals and companies to stay ahead of the competition. Dreamweaver is a powerful and flexible HTML editor that allows both designers and developers to work efficiently. It provides features for visual editing in Design view as well as powerful code editing capabilities in Code view.
The document provides instructions on how to perform common tasks in Microsoft Word like opening, creating, saving, printing, and closing documents. It explains how to access menus and buttons, enter text, and use features such as word wrap, auto correct, and spell check. Screenshots and step-by-step directions are included to guide users on performing tasks in Word.
How to Design a Logo. User Guide for Logo TemplatesMaxim Logoswish
Learn how to open and use your logo templates.
We provide quality company logo templates for small businesses and individuals, including realtors, bloggers etc. Logoswish deliver modern & creative logos.
Logoswish established their design consultancy in 2001 with a primary focus on logo design and corporate identity. We have experience working with different budget projects. We understand how to provide quality services to our customers through individual attention, and provide satisfaction to each of our clients. Logoswish provide excellent value for money.
General idea of Logoswish provides logo design for small business, individuals (who has personal business activity such as bloggers, photographers, realtors etc.), invents (Expeditions, Forums, meetings etc.) and projects visualization. We specialise in pre-made logo templates to increase both value, but also to shorten the time taken to kick-off a design identity project. Choosing the right logo or corporate design need not be a laborious task. We give you the logo you wish for.
To ensure every customer we provide services for are satisfied, feel they have received excellent value and would recommend us to a colleague or friend.
Logoswish – logos you wish.
http://www.logoswish.com
This document provides an introduction to using Dreamweaver to create websites. It covers setting up a website using Dreamweaver's site management tools, creating pages with text, images, links and tables, and basic HTML editing. The document reviews Dreamweaver's interface including the insert bar, property inspector, and site panel. It also discusses organizing files into folders to structure a website and publishing pages by saving them to the public_html folder.
OpenOffice.org Writer is a free and open-source word processor that is similar to Microsoft Word. It is part of the OpenOffice.org software suite, which also includes spreadsheet, presentation, drawing, formula, and database applications. OpenOffice.org Writer's interface and tools are very similar to Microsoft Word, making it easy for Word users to switch, and it allows documents to be opened and edited in Word format. A key advantage of OpenOffice.org Writer is that it saves files by default in the OpenDocument format, resulting in smaller file sizes than when saved in Word's .doc or .docx formats.
The document provides an overview of the Visual Studio integrated development environment (IDE). It describes popular Visual Studio features like IntelliSense, code cleanup, refactoring, and debugging tools. It also explains how to install Visual Studio, create a simple "Hello World" console app project, add and run code to prompt for a user's name and display a greeting, and view the output in the console window.
This document provides information about scripting in Adobe InDesign 2020, including a summary of InDesign's scripting documentation, directions for running scripts, descriptions of sample scripts included with InDesign, and known issues related to InDesign scripting. It directs readers to InDesign's developer documentation page for additional resources on scripting.
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static types, classes, and interfaces to JavaScript to help catch errors. TypeScript supports object-oriented programming concepts like classes, interfaces, inheritance, and modules. It is compatible with JavaScript and can reuse existing JavaScript code and libraries. The TypeScript compiler checks for errors and compiles TypeScript code into JavaScript that can run on any browser, device, or operating system that supports JavaScript.
This document discusses various basic tools used for software development including plain text, shell commands, editors, source code control, debugging, and text manipulation. It provides information on the benefits of plain text such as being readable by people and machines, being future-proof, and enabling testing. It also discusses using a single powerful editor, features of source code control, strategies for debugging, and examples of using text manipulation for tasks like documentation generation and interface creation.
Visual Studio, Eclipse, and NetBeans are three popular IDEs. Visual Studio features include automatic indentation, side-by-side editing, IntelliSense, debugging tools, and reusable code snippets. Eclipse features include file encoding settings, automatic saving, type filters, launch configurations, and code formatting options. NetBeans provides a full-featured Java EE environment out of the box and strong support for HTML5, JavaScript, and CSS development.
An introduction to Typescript for programmers who use JavaScript.
It goes through what it is, what's it useful for, how to start using it and some things I've observed while using it.
Notes are not available but feel free to PM me if you have any question.
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static types, classes, and interfaces to JavaScript to help catch errors. TypeScript is developed by Microsoft and is often used for large-scale JavaScript applications. Some key benefits of TypeScript include compilation to catch errors early, strong static typing for IntelliSense and refactoring, and support for modern JavaScript features while allowing for backwards compatibility.
The document provides an introduction to Windows programming, covering topics such as the history of Windows versions, the Windows API, common data types used in Windows programming, creating window classes and windows, and the basic components of a Windows application. Key points include that Windows is a GUI operating system developed by Microsoft, the Windows API allows development of applications across all Windows versions, and a basic Windows application contains functions like WinMain and a window procedure.
ASP is an active server page technology developed by Microsoft that allows web developers to build dynamic websites and web applications. ASP files can contain HTML tags, text, and scripting code. Scripts in ASP files are executed on the server rather than in the user's web browser. Common uses of ASP include dynamically generating and customizing web page content, accessing databases to display information to users, and providing more security since ASP code is not visible to users.
Visual Basic 6 allows developers to design graphical user interfaces and connect to databases. It uses an event-driven programming model where code executes in response to user and system events like button clicks. The document discusses connecting a VB application to a Microsoft Access database using ActiveX Data Objects (ADO). Developers add an ADO Data Control to the form, specify the database file path in its connection string, and select the table as the record source. Common ADO commands allow navigating and updating the recordset. Visual Basic provides a visual interface for building Windows applications and integrating with databases through controls like ADO.
Visual Basic 6 allows developers to design graphical user interfaces and connect to databases. It uses an event-driven programming model where code executes in response to user and system events like button clicks. The document discusses connecting a VB application to a Microsoft Access database using ActiveX Data Objects (ADO). Developers add an ADO Data Control to the form, specify the database file path in its connection string, and select the table as the record source. Common ADO commands allow navigating and updating the recordset. Visual Basic provides a visual interface for building Windows applications and integrating with databases through ADO.
This document summarizes information about versions of the Windows operating system, components of Windows 7, and features of Windows 7. It lists the versions of Windows from Windows 1.01 to Windows 10. It identifies major components of Windows 7 like the Control Panel, Device Manager, and System Restore. It describes several features of Windows 7 such as themes, desktop slideshow, gadgets, font management, and improved device management. It also provides instructions for common file operations in Windows like rename, create, cut, copy, paste, explore, search, properties, shortcut, and open.
Unit -II Introduction to visual programming.pdfUjwala Junghare
The document discusses the .NET framework and its key components - the Common Language Runtime (CLR) and .NET Framework class library. The CLR handles running applications by compiling code into an intermediate language (IL) and then translating IL into machine code. The class library provides pre-written code for common tasks that applications can utilize. Visual Basic .NET applications interact with the .NET framework through assemblies compiled to IL rather than traditional EXE files. The document also describes the Visual Studio integrated development environment and its various components used for building .NET applications.
Describe how you go from sitting in front of your system with the edit.docxandyb37
Describe how you go from sitting in front of your system with the editor fired up so you can type in code, to a running program in a computer. Your answer should cover the tools you would use and the products created by each tool. I am not interested in the software design process, just the tools used to process your code so it can run
Solution
There are various tools avaialble, where we can code as well as execute the code of different languages. These tools are given below:
1) \"Dev C++\" Tool: This tool or you can say IDE(Integrated Development Environment) is used for writting C as well as C++ Code. It also used for writting as well as compiling as well as executing the code. Code written in C language is saved in file with extension .c and code written in C++ language is saved in
file with extension .cpp. Here after compilation of code a.out file is created that will be executed to get the output
2) \"NetBeans\" Tool : Its being used to run the java program. Various gui components of java can also be created using this tool.
3) \"Eclipse\" Tool: Its being used to run the java program as well, and various gui components can also be created using java.
4) \"Visual Studio\" Tool: This tool is being used to run the program of the c# language. Its a tool of microsoft and can also be used to do coding in visual studio
.
Learn the core fundamentals of JavaScript and how to use JavaScript creating web applications.
GET the Course - https://www.udemy.com/javascript-code-course/?couponCode=SLIDESHARE
Learn JavaScript Language Fundamentals and start coding JavaScript Today.
Source Code is included so you can try the code.
Resources and tips are provided throughout the course when appropriate.
Modern JavaScript focused means that we do cover current syntax as well as foundational code. No frameworks or JavaScript libraries you can do it all with regular vanilla JavaScript.
All you need is a browser to see JavaScript in action and with a few lines of code you can do a whole lot. It’s easy let us show you.
Course covers
Setup you working development environment and get ready to write some code.
What JavaScript is and how code works. Tools and resources used to write JavaScript
How to create JavaScript Code and run it in your browser
Comments and debugging with the console
Variables and how to create and store values in code
Declaring variables assigning values
Using let and const as variables
Strings Numbers and Boolean data types
Other data types null, undefined
Best practices and rules to name variables
Using JavaScript windows methods alert and prompt
Creating template literals
Challenge #1 Using Template literals in code
JavaScript type conversion and how it works
JavaScript Operators
Comparison and Assignment operators
Challenge #2 to create a Miles to Kilometers Converter
Truthy or Falsy
JavaScript Conditions if else statements
JavaScript Conditions else if statements
Using Short ternary operator
Conditions with Multiple conditions and logical operators
Challenge #3 - Hello Greeter
JavaScript Switch statement
JavaScript Functions
JavaScript Functions arguments and default values
JavaScript Functions return values
JavaScript click events on elements
Function declaration vs expression
Function scope global vs local
Function recursion
IIFE (Immediately Invoked Function Expression)
ES6 Arrow format
JavaScript Objects
Object Method and const
Functions to create Objects
JavaScript Arrays
Array methods to do more with arrays
Array filter
JavaScript Loops and iteration
forEach, object and array data
Challenge #4 - Loops Array builder
JavaScript Map
No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.
Step by step learning with all steps included.
Beginner JavaScript knowledge is required as the course covers only JavaScript relevant to the building of the game. Also HTML and CSS knowledge is essential as scope of this course is all JavaScript focused.
Along with friendly support in the Q&A to help you learn and answer any questions you may have.
This document provides an overview and summary of Xcode 4.2, including:
- Xcode 4.2 supports Mac OS X 10.7 Lion and iOS SDK 5. It includes a new single window interface, integrated Interface Builder, and improved debugging tools.
- New features include storyboarding support in Interface Builder, an OpenGL ES graphical debugger, ARC compiler support, and additional bug fixes and performance improvements.
- Xcode requires an Intel-based Mac running Mac OS X 10.7 Lion or later. It installs the Xcode IDE, Instruments analysis tool, iOS Simulator, and SDKs for development.
Visual Basic 6 allows users to design graphical user interfaces and develop Windows applications. It uses an event-driven programming model where code executes in response to events like user input. The language provides features for creating windows, accessing databases, and using ActiveX technologies. Visual Basic compiles and interprets code as it is written to catch errors early in development. Key concepts include windows, events, and messages which allow applications to respond to user input and system events.
Bsc cs i pic u-1 introduction to c languageRai University
The document provides information on C programming language including:
- The basic building blocks of a computer like input, storage, processor, and output.
- An overview of C including its history, features, and basic structure with sections like documentation, definitions, main function, and subprograms.
- Explanations of key concepts like algorithms, flowcharts, compilers, and interpreters.
- Descriptions of operating systems like UNIX, Linux, and Windows.
This document is the first lesson of a C++ programming tutorial. It introduces the basics of C++, including how to set up a compiler, the structure of a basic C++ program with a main function, and how to use header files, namespaces, functions like cout and cin, and comments. The example program provided prints "Hello World" and uses cout to output text and cin.get() to pause the window until a key is pressed. Comments are explained as a way to describe code without the compiler treating it as executable statements.
This document is the first lesson of a C++ programming tutorial. It introduces the basics of C++, including how to set up a compiler, the structure of a basic C++ program with a main function, and how to use header files, namespaces, functions like cout and cin, and comments. The example program provided prints "Hello World" and uses cout to output text and cin.get() to pause the window until a key is pressed. Comments are explained as a way to add explanatory text to programs without affecting the code.
The document provides an introduction to Active Server Pages (ASP) including what ASP is, how it differs from HTML, how to run ASP files, and basic ASP syntax rules. Some key points:
- ASP is a Microsoft technology that allows serverside scripting for dynamic web content. It uses scripts embedded in HTML files to interact with databases and run on IIS web servers.
- Unlike HTML, ASP files are executed by the web server before being returned to the browser. This allows ASP to dynamically generate content using scripts.
- ASP files use the .asp extension and can contain HTML, scripts, and code to access data and customize pages for users. Basic syntax involves response.write to output content.
Visual Basic (VB) is a programming language and development environment created by Microsoft for building graphical user interface (GUI) applications. It uses an event-driven programming model and is ideal for rapid application development (RAD). Some key points about VB include that it has a large user base, enables access to databases, and allows building of Windows applications using pre-built components in an easy-to-understand syntax.
The document provides an overview of the Java programming language and platform. It discusses that Java is both a programming language and a platform, and describes some key characteristics of the Java language including being object-oriented, portable, high-performance, robust, and secure. It also explains that Java code is compiled to bytecode that can run on any Java Virtual Machine, allowing the same code to run on different operating systems.
This document provides a help and tutorial for TopStyle Pro version 3.11. It covers getting started with TopStyle, editing style sheets and HTML/XHTML, working with colors, previews, validation, site management, reports, mappings, customization, and third-party integration. It also includes appendices on CSS basics and tips, TopStyle tips and tricks, style sheet resources, keyboard shortcuts, and regular expressions.
TopStyle Help & <b>Tutorial</b>tutorialsruby
This document provides a table of contents for the TopStyle Pro Help & Tutorial, which teaches how to use the TopStyle software for editing style sheets and HTML/XHTML documents. It lists over 50 sections that provide explanations and instructions for features like creating and opening files, editing styles, working with colors, previews, validation, site management, reports and customizing the software. The document was created by Giampaolo Bellavite from the online help provided with TopStyle version 3.11.
This document discusses various basic tools used for software development including plain text, shell commands, editors, source code control, debugging, and text manipulation. It provides information on the benefits of plain text such as being readable by people and machines, being future-proof, and enabling testing. It also discusses using a single powerful editor, features of source code control, strategies for debugging, and examples of using text manipulation for tasks like documentation generation and interface creation.
Visual Studio, Eclipse, and NetBeans are three popular IDEs. Visual Studio features include automatic indentation, side-by-side editing, IntelliSense, debugging tools, and reusable code snippets. Eclipse features include file encoding settings, automatic saving, type filters, launch configurations, and code formatting options. NetBeans provides a full-featured Java EE environment out of the box and strong support for HTML5, JavaScript, and CSS development.
An introduction to Typescript for programmers who use JavaScript.
It goes through what it is, what's it useful for, how to start using it and some things I've observed while using it.
Notes are not available but feel free to PM me if you have any question.
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static types, classes, and interfaces to JavaScript to help catch errors. TypeScript is developed by Microsoft and is often used for large-scale JavaScript applications. Some key benefits of TypeScript include compilation to catch errors early, strong static typing for IntelliSense and refactoring, and support for modern JavaScript features while allowing for backwards compatibility.
The document provides an introduction to Windows programming, covering topics such as the history of Windows versions, the Windows API, common data types used in Windows programming, creating window classes and windows, and the basic components of a Windows application. Key points include that Windows is a GUI operating system developed by Microsoft, the Windows API allows development of applications across all Windows versions, and a basic Windows application contains functions like WinMain and a window procedure.
ASP is an active server page technology developed by Microsoft that allows web developers to build dynamic websites and web applications. ASP files can contain HTML tags, text, and scripting code. Scripts in ASP files are executed on the server rather than in the user's web browser. Common uses of ASP include dynamically generating and customizing web page content, accessing databases to display information to users, and providing more security since ASP code is not visible to users.
Visual Basic 6 allows developers to design graphical user interfaces and connect to databases. It uses an event-driven programming model where code executes in response to user and system events like button clicks. The document discusses connecting a VB application to a Microsoft Access database using ActiveX Data Objects (ADO). Developers add an ADO Data Control to the form, specify the database file path in its connection string, and select the table as the record source. Common ADO commands allow navigating and updating the recordset. Visual Basic provides a visual interface for building Windows applications and integrating with databases through controls like ADO.
Visual Basic 6 allows developers to design graphical user interfaces and connect to databases. It uses an event-driven programming model where code executes in response to user and system events like button clicks. The document discusses connecting a VB application to a Microsoft Access database using ActiveX Data Objects (ADO). Developers add an ADO Data Control to the form, specify the database file path in its connection string, and select the table as the record source. Common ADO commands allow navigating and updating the recordset. Visual Basic provides a visual interface for building Windows applications and integrating with databases through ADO.
This document summarizes information about versions of the Windows operating system, components of Windows 7, and features of Windows 7. It lists the versions of Windows from Windows 1.01 to Windows 10. It identifies major components of Windows 7 like the Control Panel, Device Manager, and System Restore. It describes several features of Windows 7 such as themes, desktop slideshow, gadgets, font management, and improved device management. It also provides instructions for common file operations in Windows like rename, create, cut, copy, paste, explore, search, properties, shortcut, and open.
Unit -II Introduction to visual programming.pdfUjwala Junghare
The document discusses the .NET framework and its key components - the Common Language Runtime (CLR) and .NET Framework class library. The CLR handles running applications by compiling code into an intermediate language (IL) and then translating IL into machine code. The class library provides pre-written code for common tasks that applications can utilize. Visual Basic .NET applications interact with the .NET framework through assemblies compiled to IL rather than traditional EXE files. The document also describes the Visual Studio integrated development environment and its various components used for building .NET applications.
Describe how you go from sitting in front of your system with the edit.docxandyb37
Describe how you go from sitting in front of your system with the editor fired up so you can type in code, to a running program in a computer. Your answer should cover the tools you would use and the products created by each tool. I am not interested in the software design process, just the tools used to process your code so it can run
Solution
There are various tools avaialble, where we can code as well as execute the code of different languages. These tools are given below:
1) \"Dev C++\" Tool: This tool or you can say IDE(Integrated Development Environment) is used for writting C as well as C++ Code. It also used for writting as well as compiling as well as executing the code. Code written in C language is saved in file with extension .c and code written in C++ language is saved in
file with extension .cpp. Here after compilation of code a.out file is created that will be executed to get the output
2) \"NetBeans\" Tool : Its being used to run the java program. Various gui components of java can also be created using this tool.
3) \"Eclipse\" Tool: Its being used to run the java program as well, and various gui components can also be created using java.
4) \"Visual Studio\" Tool: This tool is being used to run the program of the c# language. Its a tool of microsoft and can also be used to do coding in visual studio
.
Learn the core fundamentals of JavaScript and how to use JavaScript creating web applications.
GET the Course - https://www.udemy.com/javascript-code-course/?couponCode=SLIDESHARE
Learn JavaScript Language Fundamentals and start coding JavaScript Today.
Source Code is included so you can try the code.
Resources and tips are provided throughout the course when appropriate.
Modern JavaScript focused means that we do cover current syntax as well as foundational code. No frameworks or JavaScript libraries you can do it all with regular vanilla JavaScript.
All you need is a browser to see JavaScript in action and with a few lines of code you can do a whole lot. It’s easy let us show you.
Course covers
Setup you working development environment and get ready to write some code.
What JavaScript is and how code works. Tools and resources used to write JavaScript
How to create JavaScript Code and run it in your browser
Comments and debugging with the console
Variables and how to create and store values in code
Declaring variables assigning values
Using let and const as variables
Strings Numbers and Boolean data types
Other data types null, undefined
Best practices and rules to name variables
Using JavaScript windows methods alert and prompt
Creating template literals
Challenge #1 Using Template literals in code
JavaScript type conversion and how it works
JavaScript Operators
Comparison and Assignment operators
Challenge #2 to create a Miles to Kilometers Converter
Truthy or Falsy
JavaScript Conditions if else statements
JavaScript Conditions else if statements
Using Short ternary operator
Conditions with Multiple conditions and logical operators
Challenge #3 - Hello Greeter
JavaScript Switch statement
JavaScript Functions
JavaScript Functions arguments and default values
JavaScript Functions return values
JavaScript click events on elements
Function declaration vs expression
Function scope global vs local
Function recursion
IIFE (Immediately Invoked Function Expression)
ES6 Arrow format
JavaScript Objects
Object Method and const
Functions to create Objects
JavaScript Arrays
Array methods to do more with arrays
Array filter
JavaScript Loops and iteration
forEach, object and array data
Challenge #4 - Loops Array builder
JavaScript Map
No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.
Step by step learning with all steps included.
Beginner JavaScript knowledge is required as the course covers only JavaScript relevant to the building of the game. Also HTML and CSS knowledge is essential as scope of this course is all JavaScript focused.
Along with friendly support in the Q&A to help you learn and answer any questions you may have.
This document provides an overview and summary of Xcode 4.2, including:
- Xcode 4.2 supports Mac OS X 10.7 Lion and iOS SDK 5. It includes a new single window interface, integrated Interface Builder, and improved debugging tools.
- New features include storyboarding support in Interface Builder, an OpenGL ES graphical debugger, ARC compiler support, and additional bug fixes and performance improvements.
- Xcode requires an Intel-based Mac running Mac OS X 10.7 Lion or later. It installs the Xcode IDE, Instruments analysis tool, iOS Simulator, and SDKs for development.
Visual Basic 6 allows users to design graphical user interfaces and develop Windows applications. It uses an event-driven programming model where code executes in response to events like user input. The language provides features for creating windows, accessing databases, and using ActiveX technologies. Visual Basic compiles and interprets code as it is written to catch errors early in development. Key concepts include windows, events, and messages which allow applications to respond to user input and system events.
Bsc cs i pic u-1 introduction to c languageRai University
The document provides information on C programming language including:
- The basic building blocks of a computer like input, storage, processor, and output.
- An overview of C including its history, features, and basic structure with sections like documentation, definitions, main function, and subprograms.
- Explanations of key concepts like algorithms, flowcharts, compilers, and interpreters.
- Descriptions of operating systems like UNIX, Linux, and Windows.
This document is the first lesson of a C++ programming tutorial. It introduces the basics of C++, including how to set up a compiler, the structure of a basic C++ program with a main function, and how to use header files, namespaces, functions like cout and cin, and comments. The example program provided prints "Hello World" and uses cout to output text and cin.get() to pause the window until a key is pressed. Comments are explained as a way to describe code without the compiler treating it as executable statements.
This document is the first lesson of a C++ programming tutorial. It introduces the basics of C++, including how to set up a compiler, the structure of a basic C++ program with a main function, and how to use header files, namespaces, functions like cout and cin, and comments. The example program provided prints "Hello World" and uses cout to output text and cin.get() to pause the window until a key is pressed. Comments are explained as a way to add explanatory text to programs without affecting the code.
The document provides an introduction to Active Server Pages (ASP) including what ASP is, how it differs from HTML, how to run ASP files, and basic ASP syntax rules. Some key points:
- ASP is a Microsoft technology that allows serverside scripting for dynamic web content. It uses scripts embedded in HTML files to interact with databases and run on IIS web servers.
- Unlike HTML, ASP files are executed by the web server before being returned to the browser. This allows ASP to dynamically generate content using scripts.
- ASP files use the .asp extension and can contain HTML, scripts, and code to access data and customize pages for users. Basic syntax involves response.write to output content.
Visual Basic (VB) is a programming language and development environment created by Microsoft for building graphical user interface (GUI) applications. It uses an event-driven programming model and is ideal for rapid application development (RAD). Some key points about VB include that it has a large user base, enables access to databases, and allows building of Windows applications using pre-built components in an easy-to-understand syntax.
The document provides an overview of the Java programming language and platform. It discusses that Java is both a programming language and a platform, and describes some key characteristics of the Java language including being object-oriented, portable, high-performance, robust, and secure. It also explains that Java code is compiled to bytecode that can run on any Java Virtual Machine, allowing the same code to run on different operating systems.
This document provides a help and tutorial for TopStyle Pro version 3.11. It covers getting started with TopStyle, editing style sheets and HTML/XHTML, working with colors, previews, validation, site management, reports, mappings, customization, and third-party integration. It also includes appendices on CSS basics and tips, TopStyle tips and tricks, style sheet resources, keyboard shortcuts, and regular expressions.
TopStyle Help & <b>Tutorial</b>tutorialsruby
This document provides a table of contents for the TopStyle Pro Help & Tutorial, which teaches how to use the TopStyle software for editing style sheets and HTML/XHTML documents. It lists over 50 sections that provide explanations and instructions for features like creating and opening files, editing styles, working with colors, previews, validation, site management, reports and customizing the software. The document was created by Giampaolo Bellavite from the online help provided with TopStyle version 3.11.
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>tutorialsruby
This document provides the course outline for IMD 210 Fundamentals of Scripting Languages at The Art Institute of Atlanta during the Spring 2005 quarter. The course focuses on integrating programming concepts with interface design using scripting languages like JavaScript and CSS. It will cover topics like DOM, CSS layout, JavaScript variables, conditionals, and events. Students will complete 4 assignments including redesigning existing websites, and there will be weekly quizzes, a midterm, and final exam. The course is worth 4 credits and meets once a week for class and lab.
This document provides the course outline for IMD 210 Fundamentals of Scripting Languages at The Art Institute of Atlanta during the Spring 2005 quarter. The course focuses on integrating programming concepts with interface design using scripting languages like JavaScript and CSS. It will cover topics like DOM, CSS layout, JavaScript variables, conditionals, and events. Students will complete 4 assignments including redesigning existing websites, and there will be weekly quizzes, a midterm, and final exam. The course is worth 4 credits and meets once a week for class and lab.
The group aims to bridge gaps between peer-to-peer database architectures and scaling multimedia information retrieval. They develop a probabilistic multimedia database system with abstraction layers for applications and researchers. They also research challenges of peer-to-peer networks for distributed data management. Both lines are supported by the MonetDB platform to exploit custom hardware and adaptive query optimization. The goal is a modular solution linking theoretical optimal solutions to application demands under resource limitations.
Standardization and Knowledge Transfer – INS0tutorialsruby
The group aims to bridge gaps between peer-to-peer database architectures and scaling multimedia information retrieval. They develop a probabilistic multimedia database system with abstraction layers and a flexible model. They also research challenges of peer-to-peer networks for distributed data management. Both lines are supported by the MonetDB platform to exploit custom hardware and adaptive query optimization. The goal is a modular solution linking theoretical optimal solutions to application demands under resource limitations.
This document provides an introduction to converting HTML documents to XHTML, including the basic syntax changes needed like making all tags lowercase and closing all tags. It provides examples of correct XHTML markup for different tags. It also explains the new DOCTYPE declaration and shows a sample well-formed XHTML document incorporating all the discussed changes. Resources for learning more about XHTML are listed at the end.
This document provides an introduction to converting HTML documents to XHTML, including the basic syntax changes needed like making all tags lowercase and closing all tags. It provides examples of correct XHTML markup for different tags. It also explains the new DOCTYPE declaration and shows a sample well-formed XHTML document incorporating all the discussed changes. Resources for learning more about XHTML are listed at the end.
XHTML is a markup language that provides structure and semantics to web pages. It is based on XML and is more strict than HTML. XHTML pages must have a document type definition, html and head tags, and a body where the visible content goes. Common XHTML tags include paragraphs, lists, links, images, and divisions to logically separate content. While XHTML provides structure, CSS is used to style pages and control visual presentation by defining rules for tags. CSS rules are defined in external style sheets to keep presentation separate from structure and content.
XHTML is a markup language that provides structure and semantics to web pages. It is based on XML and is more strict than HTML. XHTML pages must have a document type definition, html and head tags, and a body where the visible content goes. Common XHTML tags include paragraphs, lists, links, images, and divisions to logically separate content. While XHTML provides structure, CSS is used to style pages and control visual presentation through rules that target specific XHTML elements.
This document discusses how to create and use external cascading style sheets (CSS) in Dreamweaver. It provides steps to:
1. Open the CSS Styles tab in Dreamweaver and create a new external CSS stylesheet using a sample text style.
2. Save the stylesheet and link it to a new HTML page to style elements like headings, text sizes, and boxes.
3. Edit existing styles by selecting a tag in the CSS Styles panel and modifying properties directly, or by clicking the tag and using the pencil icon to edit in a window. This allows customizing styles globally across all linked pages.
This document provides an overview of how to create and use cascading style sheets (CSS) in Dreamweaver. It describes the different types of style sheets, including external and internal style sheets. It outlines the steps to create an external style sheet in Dreamweaver using the CSS Styles panel and provides instructions for linking the external style sheet to an HTML page. The document demonstrates how to experiment with predefined styles and how to edit, add, and delete styles in the CSS stylesheet.
This document appears to be a weekly update from an intro to computer science course. It includes summaries of classmates' demographics, comfort levels, and prior experience. It also discusses time spent on problem sets and recommends upcoming courses in CS51 and CS61. Finally, it recommends reading on TCP/IP, HTTP, XHTML, CSS, PHP, SQL and using the bulletin board for questions.
This document appears to be a weekly update from an intro to computer science course. It includes summaries of classmates' demographics, comfort levels, and prior experience. It also discusses time spent on problem sets and recommends upcoming courses in CS51 and CS61. Finally, it recommends reading on topics like TCP/IP, HTTP, XHTML, CSS, PHP, SQL and using bulletin boards, and includes images related to these topics.
The document discusses how to use Cascading Style Sheets (CSS) with Corvid Servlet Runtime templates to control formatting and layout. CSS allows separating design from content, making templates simpler and easier to maintain. It also enables adapting appearance for different devices. The document provides examples of using CSS classes to style template elements and explains how to set up a demo system using the included CSS and templates.
The document discusses how to use Cascading Style Sheets (CSS) with Corvid Servlet Runtime templates to control formatting and layout. CSS allows separating design from content, making templates simpler and easier to maintain. It also enables customization of appearance for different devices. The document provides examples of how to apply CSS classes and rules to Corvid template elements to control fonts, colors, positioning and more.
The document provides an introduction to CSS and how it works with HTML to control the presentation and styling of web page content. It explains basic CSS concepts like selectors, properties and values, and how CSS rules are used to target specific HTML elements and style them. Examples are given of common CSS properties and selectors and how they can be used to style elements and format the layout of web pages.
The document introduces CSS and how it works with HTML to separate content from presentation, allowing the styling of web pages through rules that target HTML elements. It explains CSS syntax and various selectors like type, class, ID, and descendant selectors. Examples are provided of how CSS can be used to style properties like color, font, padding, and layout of elements on a page.
Cascading Style Sheets (CSS) allow users to define how HTML elements are presented on a page. CSS enables changing the appearance and layout of an entire website by editing just one CSS file. CSS uses selectors to apply styles to HTML elements via properties and values. Styles can be defined internally in HTML or externally in CSS files. CSS can control text formatting, colors, spacing, positioning and more to achieve visual consistency across web pages.
Cascading Style Sheets (CSS) allow users to define how HTML elements are presented on a page. CSS enables changing the appearance and layout of an entire website by editing just one CSS file. CSS uses selectors to apply styles to HTML elements via properties and values. Styles can be defined internally in HTML or externally in CSS files. CSS can control text formatting, colors, spacing, positioning and more to achieve visual consistency across web pages.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
20 Comprehensive Checklist of Designing and Developing a WebsitePixlogix Infotech
Dive into the world of Website Designing and Developing with Pixlogix! Looking to create a stunning online presence? Look no further! Our comprehensive checklist covers everything you need to know to craft a website that stands out. From user-friendly design to seamless functionality, we've got you covered. Don't miss out on this invaluable resource! Check out our checklist now at Pixlogix and start your journey towards a captivating online presence today.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Building RAG with self-deployed Milvus vector database and Snowpark Container...Zilliz
This talk will give hands-on advice on building RAG applications with an open-source Milvus database deployed as a docker container. We will also introduce the integration of Milvus with Snowpark Container Services.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
3. Adobe InDesign CS3 Scripting Tutorial
Introduction
Scripting is the most powerful feature in Adobe® InDesign® CS3. No other feature can save you as much
time, trouble, and money as scripting.
This document is for every InDesign user. If you never created a script before, we show you how to get
started. If you wrote scripts for other applications, we show you how to apply your knowledge to InDesign
scripting.
The document also covers how to install and run an InDesign script and describes what InDesign scripting
can and cannot do. We discuss the software you need to start writing your own scripts.
After you learn the basics of InDesign scripting in this tutorial, you can move on to Adobe InDesign CS3
Scripting Guide, which explores scripting in more depth. Adobe InDesign CS3 Scripting Guide contains
hundreds of tutorial scripts covering topics like text formatting, finding and changing text, associating
scripts with menu items, drawing objects on a page, and exporting documents.
Getting Started
Almost anything you can do with the user interface; you can do with a script. You can draw frames, enter
and format text, place graphics, and print or export the pages of the document. Any action that can
change a document or its contents can be scripted. There even are a few things you can do in scripting
that you cannot do using the user interface.
Scripts can create menus, add menu items, create and display dialog boxes and panels, and respond to
user-interface selections. Scripts can read and write text files, parse XML data, and communicate with
other applications.
Scripts can do everything from very small tasks (like setting a tab stop at the location of the text cursor) to
providing complete features (InDesign’s XHTML export feature is provided by a script). You can start with
simple scripts that do only one thing and move on to scripts that automate your entire publishing
workflow.
Most of the things scripting cannot do—like setting up a workspace or defining a set of keyboard
shortcuts—are things that have to do with the user interface. In addition, scripts cannot add new types of
objects to an InDesign document or add new, fundamental capabilities to the program, like a new
text-composition engine. For that type of extensibility, you must use the InDesign Software Development
Kit (SDK), which shows you to write compiled plug-ins using C++.
We tend to think of scripting in terms of long, repetitive tasks, like laying out a phone book. It also is good
for things like the following:
• Automating the myriad, small, annoying tasks you face every day.
• Customizing InDesign to match your work habits and layouts.
• Achieving creative effects that would be difficult or impossible to attain by other means.
3
4. Adobe InDesign CS3 Scripting Tutorial Getting Started 4
Installing Scripts
Installing an InDesign script is easy: put the script file in the Scripts Panel folder inside the Scripts folder in
your InDesign application folder. (Create the Scripts folder if it does not already exist.)
Alternately, put the script inside the Scripts Panel folder in your user-preferences folder. Your
user-preferences folder is at
Mac OS: ~/Library/Preferences/Adobe InDesign/Version 5.0/Scripts
Windows XP: ~Documents and Settingsuser_nameApplication DataAdobe
InDesignVersion 5.0Scripts
where ~ is your system volume and user_name is your user name.
Once the script is in the folder, it appears on the Scripts panel inside InDesign. To display the panel, choose
Window > Automation > Scripts.
You also can put aliases/shortcuts to scripts (or to folders containing scripts) in the Scripts Panel folder, and
they will appear in the Scripts panel.
To run a specific script when InDesign starts, put the script inside a folder named “Startup Scripts” inside
the Scripts folder (create this folder if it does not already exist).
Running a Script
To run a script, display the Scripts panel (choose Window > Automation > Scripts), then double-click the
script name in the Scripts panel. Many scripts display user-interface items (like dialog boxes or panels) and
display alerts if necessary.
Using the Scripts Panel
The InDesign Scripts panel is the easiest and best way to run most InDesign scripts. If the panel is not
already visible, you can display it by choosing Window > Automation > Scripts.
Scripts run from the Scripts panel run faster than scripts run from the Finder (Mac OS®) or Explorer
(Windows®). To view the script actions as they execute, choose Enable Redraw from the Scripts panel
menu.
The Scripts panel can run compiled or uncompiled AppleScripts (files with the file extension .spt, .as, or
.applescript), JavaScripts (files with the file extension .js or .jsx), VBScripts (files with the extension
.vbs), or executable programs from the Scripts panel.
To edit a script shown in the Scripts panel, hold down Option (Mac OS) or Alt (Windows) key and
double-click the script’s name. This opens the script in the editor you defined for the script file type.
To open the folder containing a script shown in the Scripts panel, hold down the Command (Mac OS) or
Ctrl-Shift (Windows) keys and double-click the script’s name. Alternately, choose Reveal in Finder (Mac OS)
or Reveal in Explorer (Windows) from the Scripts panel menu. The folder containing the script opens in the
Finder (Mac OS) or Explorer (Windows).
Scripts run as a series of actions, which means you can undo the changes the script made to a document
by choosing Undo from the Edit menu. This can help you troubleshoot a script, as you can step backward
through each change.
5. Adobe InDesign CS3 Scripting Tutorial Getting Started 5
To add a keyboard shortcut for a script, choose Edit > Keyboard Shortcuts, select an editable shortcut set
from the Set menu, then choose Product Area > Scripts. A list of the scripts in your Scripts panel appears.
Select a script and assign a keyboard shortcut as you would for any other InDesign feature.
About Scripting Languages
The language you use to write scripts depends on the scripting system of your platform: AppleScript for
Mac OS, VBScript for Windows, or JavaScript for either platform. Although the scripting languages differ,
the ways they work with InDesign are very similar.
Each sample script in this document is shown in all three scripting languages. Translating a script from one
language to another is fairly easy.
JavaScript
InDesign supports JavaScript for cross-platform scripting in both Mac OS and Windows. InDesign’s
JavaScript support is based on an Adobe implementation of JavaScript known as ExtendScript. The
ExtendScript interpreter conforms to the current, ECMA 262 standard for JavaScript. All language features
of JavaScript 1.5 are supported. Adobe Illustrator®, Adobe Photoshop®, and other Adobe Creative Suite®
products also use the ExtendScript JavaScript interpreter.
While you can write scripts using other versions of JavaScript, like Microsoft® JScript (in Windows) or Late
Night Software’s OSA JavaScript (on the Mac OS), the terms you use in those languages are not the same as
the terms you use in ExtendScript. ExtendScript examples do not work in other JavaScript versions.
Note: Because ExtendScript tools and features are used in several Adobe products, we consolidated all
ExtendScript documentation. To learn more about JavaScript utilities like the ScriptUI user-interface
module and the ExtendScript Toolkit (a JavaScript development environment and object-model
inspector), see Creative Suite 3 JavaScript Tools Guide.
Mac OS
To use InDesign scripting on Mac OS, you can use either JavaScript or AppleScript. To write AppleScripts,
you must have AppleScript version 1.6 or higher and an AppleScript script editor. AppleScript comes with
all Apple® systems, and it can be downloaded free from the Apple Web site. The Apple Script Editor is
included with the Mac OS; third-party script editors, like Script Debugger (from Late Night Software,
http://www.latenightsw.com) also are available.
Windows
To use InDesign scripting in Windows, you can use either JavaScript or some version of Microsoft Visual
Basic, like VBScript.
The Visual Basic tutorial scripts are written in VBScript. We chose VBScript because no added software is
required to run or edit VBScripts; you can edit them with any text editor (like Notepad) and run them using
the InDesign Scripts panel.
Other versions of Visual Basic include Visual Basic 5 Control Creation Edition (CCE), Visual Basic 6, Visual
Basic .NET, and Visual Basic 2005 Express Edition. Versions of Visual Basic prior to Visual Basic .NET work
well with InDesign scripting. Visual Basic .NET and newer versions work less well, because they lack the
Variant data type, which is used extensively in InDesign scripting.
6. Adobe InDesign CS3 Scripting Tutorial Getting Started 6
Many applications contain Visual Basic for Applications (VBA), like Microsoft Word, Microsoft Excel,
Microsoft Visio, or AutoCAD. Although you can use VBA to create InDesign scripts, InDesign does not
include VBA.
To use VBScript or Visual Basic for InDesign scripting in Windows XP, you must install InDesign from a user
account that has Administrator privileges. After you complete the installation, any user can run InDesign
scripts, and any user can add scripts to the InDesign Scripts panel.
Which Scripting Language should you use?
If you have written scripts before, use whatever language you know. If you have never written scripts
before or if you need to make your scripts work on both the Mac OS and Windows versions of InDesign,
use JavaScript. If you need to communicate with other, non-Adobe applications on your system, use the
appropriate, platform standard language (AppleScript on Mac OS or VBScript in Windows).
We cannot fully document the language features of AppleScript, JavaScript, or VBScript, so you may need
documentation for any or all those scripting languages.
Note: You also can use almost any other programming language (like Python or C#) that can connect to
the platform standard automation system; that is beyond the scope of this document.
How to use the Scripts in this Document
To use any script from this document, either open the tutorial script file (the filename is given before each
script) or follow these steps:
1. Copy the script from this Adobe PDF document and paste it into your script editor, such as the
ExtendScript Toolkit (for JavaScript examples), the Apple Script Editor (for AppleScript examples), or a
text editor like Notepad (for VBScript examples).
2. Save the script as a plain text file in the Scripts Panel folder (see “Installing Scripts” on page 4), using
the appropriate file extension:
AppleScript: .applescript
JavaScript: .jsx
VBScript: .vbs
3. Choose Windows > Automation > Scripts, to display the Scripts panel.
4. Double-click the script name in the Scripts panel, to run the script.
Note: If you are entering the JavaScript examples, it is very important to use the same capitalization
shown in the example. JavaScript is case-sensitive, and the scripts will fail if they do not use the
capitalization shown. The AppleScript and VBScript examples are not case-sensitive.
Note: If you are copying and pasting scripts from this document, be aware that line breaks caused by the
layout of the document can cause errors in your script. As it can be very difficult to find such errors,
we recommend hat you use the scripts in the zip archive.
7. Adobe InDesign CS3 Scripting Tutorial Getting Started 7
Your First InDesign Script
Next, we will create an InDesign script that creates a new document, adds a text frame, and enters text in
the text frame. This demonstrates how to do the following:
• Establish communication with InDesign.
• Create a new document.
• Create a text frame on a specific page.
• Add text to a text frame.
AppleScript
Start the Script Editor application (you can find it in your Applications folder, inside the AppleScript folder).
Enter the following script (or open the HelloWorld.applescript tutorial script):
tell application "Adobe InDesign CS3"
set myDocument to make document
tell page 1 of myDocument
set myTextFrame to make text frame
set geometric bounds of myTextFrame to {"6p", "6p", "24p", "24p"}
set contents of myTextFrame to "Hello World!"
end tell
end tell
Save the script as text with the file extension .applescript to the Scripts Panel folder (see “Installing
Scripts” on page 4). To run the script, double-click the script name in the Scripts panel or click the Run
button in the Script Editor window.
JavaScript
Start the ExtendScript Toolkit (or a text editor). Enter the following script (or open the HelloWorld.jsx
tutorial script):
var myDocument = app.documents.add();
var myTextFrame = myDocument.pages.item(0).textFrames.add();
myTextFrame.geometricBounds = ["6p", "6p", "24p", "24p"];
myTextFrame.contents = "Hello World!";
Save the script as a plain-text file with the .jsx file extension to the Scripts Panel folder (see “Installing
Scripts” on page 4). To run the script, double-click the script name in the Scripts panel, or select InDesign
from the application target pop-up menu in the ExtendScript Toolkit and then click the Run button).
VBScript
Start a text editor (e.g., Notepad) and enter the following script (or open the HelloWorld.vbs tutorial
script):
Set myInDesign = CreateObject("InDesign.Application.CS3")
Set myDocument = myInDesign.Documents.Add
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
myTextFrame.GeometricBounds = Array("6p", "6p", "24p", "24p")
myTextFrame.Contents = "Hello World!"
Save the script as a text file with the .vbs file extension to the Scripts Panel folder (see“Installing Scripts”
on page 4). To run the script, double-click the script name in the Scripts panel.
8. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 8
Walking through the Script
Examining the script presented above, here is a step-by-step analysis of what the script does (in each
scripting language):
1. Establish communication with the InDesign application object:
AppleScript: tell application "Adobe InDesign CS3"
JavaScript: Refer to the application as app.
VBScript: Set myInDesign = CreateObject("InDesign.Application.CS3")
2. Create a new document and a reference to the document:
AppleScript: Set myDocument to make document
JavaScript: Var myDocument = app.documents.add();
VBScript: Set myDocument = myInDesign.Documents.Add
3. Create a new text frame on the first page and a create a reference to the text frame.:
AppleScript: tell page 1 of myDocument
set myTextFrame to make text frame
JavaScript: var myTextFrame = myDocument.pages.item(0).textFrames.add();
VBScript: Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
4. Set the geometric bounds (the location of the top, left, bottom, and right edges) of the text frame. In
this step, the script uses measurement overrides (“p” for picas) to ensure the text frame is the correct
size, regardless of your default measurement units. The locations are provided as a list, or array, of val-
ues; each scripting language has a slightly different way of creating an array. For more on array vari-
ables, see “Array Variables” on page 11.
AppleScript: set geometric bounds of myTextFrame to {"6p", "6p", "24p", "24p"}
JavaScript: myTextFrame.geometricBounds = ["6p", "6p", "24p", "24p"];
VBScript: myTextFrame.GeometricBounds = Array("6p", "6p", "24p", "24p")
5. Add text to the text frame by setting the contents property to a string.:
AppleScript: set contents of myTextFrame to "Hello World!"
JavaScript: myTextFrame.contents = "Hello World!";
VBScript: myTextFrame.Contents = "Hello World!"
Scripting and the InDesign Object Model
This section discusses the terminology of scripting languages in general and InDesign scripting in
particular.
Scripting Terminology
This section discusses common scripting terms and concepts.
9. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 9
Comments
Comments give you a way to add descriptive text to a script. The scripting system ignores comments as
the script executes; this prevents comments from producing errors when you run your script. Comments
are useful to document the operation of a script (for yourself or someone else). In this document, we use
comments in the tutorial scripts.
To include a comment in an AppleScript, type -- to the left of your comment or surround the comment
with (* and *). In VBScript, type Rem (for “remark”) or ' (a single straight quote) to the left of the
comment. Type the comment marker at the beginning of a line, to make the entire line a comment. In
JavaScript, type // to the left of the comment, or surround the comment with /* and */. For example:
AppleScript: --this is a comment
* and so is this *)
JavaScript: // this is a comment
/* and so is this */
VBScript: Rem this is a comment
' and so is this
Values
The point size of a character of text, the location of a text frame on a page, and the color of stroke of a
rectangle are examples of values used in InDesign scripting. Values are the data your scripts use to do their
work.
The type of a value defines what sort of data the value contains. For example, the value type of the
contents of a word is a text string, and the value type of the leading of a paragraph is a number. Usually,
the values used in scripts are numbers or text. The following table explains the value types most
commonly used in InDesign scripting:
Value Type What it is Example
Boolean Logical True or False. True
Integer Whole numbers (no decimal 14
points). Integers can be positive
or negative. In VBScript, you can
use the long data type for
integers. In AppleScript, you
also can use the fixed or long
data types for both integers and
real numbers.
Double (VBScript), A high-precision number that 13.9972
fixed or real can contain a decimal point.
(AppleScript),
floating point
(JavaScript)
String A series of text characters. "I am a string"
Strings appear inside (straight)
quotation marks.
10. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 10
Value Type What it is Example
Array (VBScript, A list of values (the values can AppleScript:
JavaScript) be any type). {"0p0", "0p0", "16p4", "20p6"}
or list (AppleScript)
VBScript:
Array("0p0", "0p0", "16p4", "20p6")
JavaScript:
["0p0", "0p0", "16p4", "20p6"]
Converting Values from one Type to Another
All scripting languages supported by InDesign provide ways to convert variable values from one type to
another. The most common conversions involve converting numbers to strings (so you can enter them in
text or display them in dialog boxes) or converting strings to numbers (so you can use them to set a point
size or page location). See the examples below.
AppleScript:
--To convert from a number to a string:
set myNumber to 2
set myString to (myNumber as string)
--To convert from a string to a number:
set myString to "2"
set myNumber to (myString as integer)
--if your string contains a decimal value, use "as real" rather than "as integer"
JavaScript:
//To convert from a number to a string:
myNumber = 2;
myString = myNumber + "";
//To convert from a string to an integer:
myString = "2";
myNumber = parseInt(myString);
//If your string contains a decimal value, use "parseFloat" rather than
"parseInt":
myNumber = parseFloat(myString);
//You can also convert strings to numbers using the following:
myNumber = +myString;
VBScript:
Rem To convert from a number to a string:
myNumber = 2
myString = cstr(myNumber)
Rem To convert from a string to an integer:
myString = "2"
myNumber = cInt(myString)
Rem If your string contains a decimal value, use "cDbl" rather than "cInt":
myNumber = cDbl(myString)
11. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 11
Variables
A variable is a container for a value. They are called “variables” because the values they contain might
change. A variable might hold a number, a string of text, or a reference to an InDesign object. Variables
have names, and you refer to a variable by its name. To put a value into a variable, you assign the data to
the variable.
In our first sample script, above, we used the variables myDocument and myTextFrame to avoid having to
provide the full specification of the object (such as text frame 1 of page 1 of document 1 or
app.documents.item(0).pages.item(0).textFrames.item(0)) every time we refer to the object.
In all the sample and tutorial scripts that come with InDesign, all variables start with my. This way, you can
easily differentiate variables we created in a script from the scripting language terms.
Assigning a Value to a Variable
Assigning values or strings to variables is fairly simple, as shown in the following table:
Language Examples of Assigning a Value to a Variable
AppleScript set myNumber to 10
set myString to "Hello, World!"
set myTextFrame to make text frame at page 1 of myDocument
JavaScript var myNumber = 10;
var myString = "Hello, World!";
var myTextFrame = myDocument.pages.item(0).textFrames.add();
VBScript myNumber = 10
myString = "Hello, World!"
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
Note: In JavaScript, all variables not preceded by var are considered global by default; that is, they are not
bound to a specific function. var is not required, but we recommend you use var in any script with
more than one function. In AppleScript and VBScript, variables are local unless specifically defined
as global variables. This means the variables do not persist outside the function in which they are
created.
Try to use descriptive names for your variables, like firstPage or corporateLogo, rather than x or c. This
makes your script easier to read. Longer names do not affect the execution speed of the script.
Variable names must be one word, but you can use internal capitalization (myFirstPage) or underscore
characters (my_first_page) to create more readable names. Variable names cannot begin with a
number, and they cannot contain punctuation or quotation marks.
Array Variables
AppleScript, JavaScript, and VBScript support arrays, which is a variable type that is a list of values. In
AppleScript, an array is called a list. Examples of defining arrays are shown below:
12. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 12
Language Examples of Defining Arrays
AppleScript set myArray to {1, 2, 3, 4}
JavaScript myArray = [1, 2, 3, 4];
VBScript myArray = Array(1, 2, 3, 4)
Rem In Visual Basic.NET: myArray = New Double (1, 2, 3, 4)
To refer to an item in an array, refer to the item by its index in the array. The first item in an array in VBScript
and JavaScript is item 0; in AppleScript, item 1. Examples of referring to items in an array are shown below:
Language Examples of Referring to an Item in an Array
AppleScript set myFirstArrayItem to item 1 of myArray
JavaScript var myFirstArrayItem = myArray[0];
VBScript myFirstArrayItem = myArray(0)
Note: The Visual Basic OptionBase statement can be used to set the first item of an array to item 1. In the
examples in this document, the first item in an array is item 0, not item 1, because that is the default.
If you set OptionBase to 1, you must adjust all array references in the sample scripts accordingly.
Arrays can include other arrays, as shown in the following table:
Language Examples
AppleScript set myArray to {{0, 0}, {72, 72}}
VBScript myArray = Array(Array(0,0), Array(72, 72))
Rem In Visual Basic.NET: myArray = New Array(New Double(0,0),
NewDouble (0,0))
JavaScript var myArray = [[0,0], [72,72]];
Finding the Value Type of a Variable
Sometimes, your scripts must make decisions based on the value type of an object. For example, if you are
working on a script that operates on a text selection, you might want that script to stop if the type of the
selection is a page item. All the scripting languages allow you to determine the type of a variable.
AppleScript:
-- Given a variable of unknown type, "myMysteryVariable"...
set myType to class of myMysteryVariable
--myType will be an AppleScript type (e.g., rectangle)
JavaScript:
//Given a variable of unknown type, "myMysteryVariable"...
myType = myMysteryVariable.constructor.name;
//myType will be a string corresponding to the JavaScript type (e.g., "Rectangle")
13. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 13
VBScript:
Rem Given a variable of unknown type, "myMysteryVariable"...
myType = TypeName(myMysteryVariable)
Rem myType will be a string corresponding to the variable type (e.g., "Rectangle")
Operators
Operators use variables or values to perform calculations (addition, subtraction, multiplication, and
division) and return a value. For example:
MyWidth/2
This returns a value equal to half of the content of the variable myWidth.
You also can use operators to perform comparisons: equal to (=), not equal to(<>), greater than(>), or less
than(<). For example:
MyWidth > myHeight
This returns true (or 1) if myWidth is greater than myHeight; otherwise, false (0).
All the scripting languages provide additional utility operators. In AppleScript and VBScript, the
ampersand (&) concatenates (or joins) two strings:
"Pride " & "and Prejudice"
This returns the following string:
"Pride and Prejudice"
In JavaScript, use the plus sign (+) to join the two strings:
"Pride " + "and Prejudice"
//returns the string: "Pride and Prejudice"
Conditional Statements
“If the selected object is a rectangle, set its stroke weight to 12 points.” This is an example of a conditional
statement. Conditional statements make decisions; they give your scripts a way to evaluate something (like
the color of the selected object, the number of pages in the publication, or the date) and act based on the
result. Conditional statements almost always start with if.
Note: Conditional statements often make logical comparisons. In AppleScript and VBScript, use the
equals sign (=) to compare objects. In JavaScript, the equals sign assigns a value to a variable; to
compare objects, use a double equals sign (==).
Control Structures
If you could talk to InDesign, you might say, “Repeat the following procedure 20 times.” In scripting terms,
this is a control structure. Control structures provide repetitive processes, or loops. The idea of a loop is to
repeat an action over and over, with or without changes between instances (or iterations) of the loop, until
a specific condition is met. Control structures usually start with repeat (in AppleScript) or for (in
JavaScript and VBScript).
14. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 14
Functions and Handlers
Functions (in VBScript or JavaScript) or handlers (in AppleScript) are scripting modules you can refer to
within your script. Typically, you send a value or series of values to a function (or handler) and get back
some other value or values. The code used in functions and handlers is simply a convenience to avoid
having to type the same lines of code repeatedly in your script.
In AppleScript, handlers start with on. In JavaScript and VBScript, functions start with function.
Understanding the InDesign Object Model
When you think about InDesign and InDesign documents, you probably organize the program and its
components in your mind. You know paragraphs are contained by text frames which, in turn, appear on a
page. A page is a part of a spread, and one or more spreads make up a document. Documents contain
colors, styles, layers, and master spreads. As you think about the layouts you create, you intuitively
understand there is an order to them.
InDesign “thinks” about the contents of a document in the same way. A document contains pages, which
contain page items (text frames, rectangles, ellipses, and so on). Text frames contain characters, words,
paragraphs, and anchored frames; graphics frames contain images, EPS files, or PDF files; and groups
contain other page items. The things we mention here are the objects that make up an InDesign
publication, and they are what we work with when we write InDesign scripts.
Objects in your publication are arranged in a specific order: frames are on pages, which are inside a
document, which is inside the InDesign application object. When we speak of an object model or a
hierarchy, we are talking about this structure. Understanding the object model is the key to finding the
object you want to work with, and your best guide to InDesign scripting is your knowledge of InDesign
itself.
Objects have properties (attributes). For example, the properties of a text object include the font used to
format the text, the point size, and the leading applied to the text.
Properties have values; for example, the point size of text can be either a number (in points) or the string
“Auto” for auto leading. The fill color property of text can be set to a color, a gradient, a mixed ink, or a
swatch.
Properties also can be read/write or read only. Read/write properties can be set to other values; read only
properties cannot.
Objects also have methods—the verbs of the scripting world, or the actions an object can perform. For
example, the document object has print, export, and save methods.
Methods have parameters, or values that define the effect of the method. For example, the place method
of a document has a parameter that defines the file you want to place. Parameters can be required or
optional, depending on the method.
The following figure is an overview of the InDesign object model. The diagram is not a comprehensive list
of the objects available to InDesign scripting; instead, it i s a conceptual framework for understanding the
relationships between the types of objects.
15. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 15
application
documents
a document
libraries document preferences
books document defaults
application preferences document events
application defaults document properties
application events document methods
application menus document elements
application properties pages or spreads
application methods page
stories page items
text objects
The objects in the diagram are explained in the following table:
Term What it Represents
Application InDesign.
Application Application default settings, like colors, paragraph styles, and object styles.
defaults Application defaults affect all new documents.
Application The things that happen as a user or script works with the application. Events are
events generated by opening, closing, or saving a document or choosing a menu item.
Scripts can be triggered by events.
Application The menus, submenus, and context menus displayed in the InDesign user interface.
menus Scripts can be attached to menu choices and can execute menu actions.
Application The actions the application can take; for example, finding and changing text,
methods copying the selection, creating new documents, and opening libraries.
Application For example, text preferences, PDF export preferences, and document preferences.
preferences Many of the preferences objects also exist at the document level. Just as in the user
interface, application preferences are applied to new documents. Document
preferences change the settings of a specific document.
Application The properties of the application; for example, the full path to the application, the
properties locale of the application, and the user name.
Books A collection of open books.
Document An InDesign document.
Document Document default settings, like colors, paragraph styles, and text formatting
defaults defaults.
16. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 16
Term What it Represents
Document For example, the stories, imported graphics, and pages of a document. The figure
elements that precedes this table shows pages and stories, because those objects are very
important containers for other objects, but document elements also include
rectangles, ovals, groups, XML elements, and any other type of object you can
import or create.
Document events Events that occur at the document level, like importing text. See “application
events” in this table.
Document The actions the document can take; for example, closing a document, printing a
methods document, and exporting a document.
Document The preferences of a document, like guide preferences, view preferences, and
preferences document preferences.
Document For example, the document filename, number of pages, and zero point location.
properties
Documents A collection of open documents.
Libraries A collection of open libraries.
Page A single page in an InDesign document.
Page items Any object you can create or place on a page. There are many types of page items,
such as text frames, rectangles, graphic lines, or groups.
Pages or spreads The pages or spreads in an InDesign document.
Stories The text in an InDesign document.
Text objects Characters, words, lines, paragraphs, and text columns are examples of text objects
in an InDesign story.
Looking at the InDesign Object Model
You can view the InDesign object model from inside your script-editing application. All reference
information on objects and their properties and methods is stored in the model and can be viewed
AppleScript
To view the InDesign AppleScript dictionary:, follow these steps:
1. Start InDesign.
2. Start the Apple Script Editor.
3. In the Script Editor, choose File > Open Dictionary. The Script Editor displays a list of scriptable applica-
tions:
17. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 17
4. Select your copy of InDesign, and click OK. The Script Editor displays a list of InDesign’s suites (collec-
tions of related objects):
5. Select a suite, to see the objects and methods (commands) it contains. Select an object, to see the
properties associated with it.
JavaScript
To view the InDesign object model in the ExtendScript Toolkit, follow these steps:
1. Start the ExtendScript Toolkit.
2. Choose Help > InDesign CS3 Main Dictionary. The ExtendScript Toolkit loads the InDesign dictionary
and displays it in a separate window.
3. From the Classes list, select the object you want to view, then click the property or method you want
to view in more detail in the Properties and Methods list. The ExtendScript toolkit displays more infor-
mation on the property or method you selected:
18. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 18
Note: For more on using the ExtendScript Toolkit object-model viewer, see Creative Suite 3 JavaScript Tools
Guide.
VBScript
To view the InDesign object model, you need a VBScript editor/debugger or some version of Visual Basic,
or an application that incorporates Visual Basic for Applications.
➤ Visual Basic 6
To view the object model using Visual Basic 6, follow these steps:
1. Create a new Visual Basic project, then choose Project > References. Visual Basic displays the Refer-
ences dialog box:
2. From the list of available references, select Adobe InDesign CS3 Type Library, and click OK. If the library
does not appear in the list of available references, click Browse and locate and select the file Resources
for Visual Basic.tlb, which is usually inside ~:Documents and
Settingsuser_nameApplication DataAdobeInDesignVersion 5.0Scripting
Support (where user_name is your user name). If necessary, search for the file. Once you locate the
file, click Open to add the reference to your project.
3. Choose View > Object Browser. Visual Basic displays the Object Browser dialog box.
4. From the list of open libraries shown in the Project/Library menu, choose InDesign. Visual Basic dis-
plays the objects that make up the InDesign object model.
19. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 19
5. Click an object class. Visual Basic displays the properties and methods of the object. For more informa-
tion on a property or method, select the item; Visual Basic displays the definition of the item at the
bottom of the Object Browser window:
➤ Visual Basic.NET
To view the object model using Visual Basic.NET, follow these steps:
1. Create a new Visual Basic project, then choose Project > Add Reference. Visual Basic displays the Add
Reference dialog box.
2. Select the COM tab.
3. From the list of available references, select Adobe InDesign CS3 Type Library, and click Select. Visual
Basic.NET adds the reference to the Selected Components list. If the library does not appear in the list
of available references, click Browse and locate and select the Resources for Visual .tlb file,
which usually is in ~:Documents and Settingsuser_nameApplication
DataAdobeInDesignVersion 5.0Scripting Support (where user_name is your user
name). Once you find the file, click Open to add the reference to your project:
4. Click OK.
5. Choose View > Object Browser. Visual Basic displays the Object Browser tab.
20. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 20
6. From the list of open libraries in the Objects window, choose interop.indesign. Visual Basic.NET dis-
plays the objects that make up the InDesign object model.
7. Click an object class. Visual Basic.NET displays the properties and methods of the object. For more
information on a property or method, select the item; Visual Basic.NET displays the definition of the
item at the bottom of the Object Browser window:
➤ Visual Basic for Applications
To view the object model using Visual Basic for Applications from Microsoft Excel, follow these steps:
1. Start Excel.
2. Choose Tools > Macros > Visual Basic Editor. Excel displays the Visual Basic Editor window.
3. Choose Tools > References. The Visual Basic Editor displays the Add References dialog box:
4. From the list of available references, select Adobe InDesign CS3 Type Library option, and click Select.
Visual Basic adds the reference to the Selected Components list. If the library does not appear in the
list of available references, click Browse and locate and select the Resources for Visual Basic.tlb
file, which usually is in ~:Documents and Settingsuser_nameApplication
DataAdobeInDesignVersion 5.0Scripting Support (where user_name is your user
name). Once you find the file, click OK to add the reference to your project.
5. Choose View > Object Browser. The Visual Basic editor display the Object Browser window.
21. Adobe InDesign CS3 Scripting Tutorial Scripting and the InDesign Object Model 21
6. From the Libraries pop-up menu, choose InDesign. The Visual Basic editor displays a list of the objects
in the InDesign object library.
7. Click an object name. The Visual Basic Editor displays the properties and methods of the object. For
more information on a property or method, select the item; Visual Basic displays the definition of the
item at the bottom of the Object Browser window:
Measurements and Positioning
All items and objects in InDesign are positioned on the page according to measurements you choose. It is
useful to know how the InDesign coordinate system works and what measurement units it uses.
Coordinates
InDesign, like every other page-layout and drawing program, uses simple, two-dimensional geometry to
set the position of objects on a page or spread. The horizontal component of a coordinate pair is referred
to as x; the vertical component, y. You can see these coordinates in the Transform panel or Control when
you select an object using the Selection tool. As in the InDesign user interface, coordinates are measured
relative to the current location of the ruler’s zero point.
There is one difference between the coordinates used in InDesign and the coordinate system used in a
Geometry textbook: on InDesign’s vertical (or y) axis, coordinates below the zero point are positive
numbers; coordinates above the zero point are negative numbers.
Note: When you ask InDesign for the location of a path point, the coordinates are returned in x, y order.
When you set the location of a path point, InDesign expects you to provide the coordinates in the
same order. InDesign returns some coordinates in a different order, however, and it expects you to
supply them in that order. Geometric bounds and visible bounds are arrays containing four
coordinates, which define (in order) the top, left, bottom, and right edges of the object’s bounding
box (or y1, x1, y2, x2).
Working with Measurement Units
When you send measurement values to InDesign, you can send numbers (for example, 14.65) or
measurement strings (for example, “1p7.1”). If you send numbers, InDesign uses the publication’s current
units of measurement. If you send measurement strings (see the table below), InDesign uses the units of
measurement specified in the string.
22. Adobe InDesign CS3 Scripting Tutorial Adding Features to “Hello World” 22
InDesign returns coordinates and other measurement values using the publication’s current measurement
units. In some cases, these units do not resemble the measurement values shown in the InDesign
Transform panel. For example, if the current measurement system is picas, InDesign returns fractional
values as decimals, rather than using the picas-and-points notation used by the Transform panel. “1p6,” for
example, is returned as “1.5.” InDesign does this because your scripting system would have trouble trying
to perform arithmetic operations using measurement strings; for instance, trying to add “0p3.5” to “13p4”
produces a script error, while adding .2916 to 13.333 (the converted pica measurements) does not.
If your script depends on adding, subtracting, multiplying, or dividing specific measurement values, you
might want to set the corresponding measurement units at the beginning of the script. At the end of the
script, you can set the measurement units back to whatever they were before you ran the script.
Alternately, you can use measurement overrides, like many of the sample scripts. A measurement override
is a string containing a special character, as shown in the following table:
Override Meaning Example
c Ciceros (add didots after the c, if necessary) 1.4c
cm Centimeters .635cm
i (or in) Inches .25i
mm Millimeters 6.35mm
p Picas (add points after the p, if necessary) 1p6
pt Points 18pt
Adding Features to “Hello World”
Next, we will create a new script that makes changes to the “Hello World” publication that we created with
our first script. Our second script demonstrates how to do the following:
• Get the active document.
• Use a function (or handler in AppleScript).
• Get the page dimensions and page margins of the active document.
• Resize a text frame.
• Change the formatting of the text in the text frame.
AppleScript
Either open the ImprovedHelloWorld.applescript tutorial script, or perform the following steps to create
the script:
1. Make sure you have the Hello World document open. If you closed the document without saving it,
simply run the HelloWorld.applescript script again to make a new Hello World document.
2. In the Script Editor, choose File > New to create a new script.
23. Adobe InDesign CS3 Scripting Tutorial Adding Features to “Hello World” 23
3. Enter the following code:
--Improved "Hello World"
tell application "Adobe InDesign CS3"
--Get a reference to a font.
try
--Enter the name of a font on your system, if necessary.
set myFont to font "Helvetica"
end try
--Get the active document and assign
--the result to the variable "myDocument."
set myDocument to document 1
tell myDocument
--Use the handler "myGetBounds" to get the bounds of the
--"live area" inside the margins of page 1.
set myBounds to my myGetBounds(myDocument, page 1)
tell text frame 1 of page 1
--Resize the text frame to match the page margins.
set geometric bounds to myBounds
tell paragraph 1
--Change the font, size, and paragraph alignment.
try
set applied font to myFont
end try
set point size to 72
set justification to center align
end tell
end tell
end tell
end tell
--myGetBounds is a handler that returns the bounds
--of the "live area" of a page.
on myGetBounds(myDocument, myPage)
tell application "Adobe InDesign CS2"
set myPageHeight to page height of document preferences of myDocument
set myPageWidth to page width of document preferences of myDocument
set myLeft to left of margin preferences of myPage
set myTop to top of margin preferences of myPage
set myRight to right of margin preferences of myPage
set myBottom to bottom of margin preferences of myPage
end tell
set myRight to myPageWidth - myLeft
set myBottom to myPageHeight - myBottom
return {myTop, myLeft, myBottom, myRight}
end myGetBounds
4. Save the script.
5. Run the new script.
24. Adobe InDesign CS3 Scripting Tutorial Adding Features to “Hello World” 24
JavaScript
Either open the ImprovedHelloWorld.jsx tutorial script, or perform the following steps to create the
script:
1. Make sure you have the Hello World document open. If you closed the document without saving it,
simply run the HelloWorld.jsx script again to make a new Hello World document.
2. Enter the following JavaScript in a new text file:
//Improved Hello World!
//Enter the name of a font on your system, if necessary.
myFont = app.fonts.item("Arial");
var myDocument = app.documents.item(0);
with(myDocument){
var myPage = pages.item(0);
var myBounds = myGetBounds(myPage,myDocument);
with(myDocument.pages.item(0)){
//Get a reference to the text frame.
var myTextFrame = textFrames.item(0);
//Change the size of the text frame.
myTextFrame.geometricBounds = myBounds;
var myParagraph = myTextFrame.paragraphs.item(0);
myParagraph.appliedFont = myFont;
myParagraph.justification = Justification.centerAlign;
myParagraph.pointSize = 48;
}
}
//myGetBounds calculates and return the bounds of the "live area" of the page.
function myGetBounds(myDocument, myPage){
var myWidth = myDocument.documentPreferences.pageWidth;
var myHeight = myDocument.documentPreferences.pageHeight;
var myX1 = myPage.marginPreferences.left;
var myY1 = myPage.marginPreferences.top;
var myX2 = myWidth - myPage.marginPreferences.right;
var myY2 = myHeight - myPage.marginPreferences.bottom;
return [myY1, myX1, myY2, myX2];
}
3. Save the text as a plain text file with the file extension .jsx in the Scripts Panel folder (see “Installing
Scripts” on page 4).
4. Run the new script, by double-clicking the script name in the InDesign Scripts panel.
VBScript
Either open the ImprovedHelloWorld.vbs tutorial script, or perform the following steps to create the
script:
1. Start any text editor (for example, Notepad).
2. Make sure you have the Hello World document open. If you closed the document without saving it,
simply run the HelloWorld.vbs script again to make a new Hello World document.
25. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 25
3. Enter the following code:
Set myInDesign = CreateObject("InDesign.Application.CS3")
Rem Enter the name of a font on your system, if necessary.
Set myFont = myInDesign.Fonts.Item("Arial")
Set myDocument = myInDesign.ActiveDocument
Set myPage = myDocument.Pages.Item(1)
Rem Get page width and page height using the function "myGetBounds".
myBounds = myGetBounds(myDocument, myPage)
Set myTextFrame = myPage.TextFrames.Item(1)
Rem Resize the text frame to match the publication margins.
myTextFrame.GeometricBounds = myBounds
Set myParagraph = myTextFrame.Paragraphs.Item(1)
Rem Change the font, size, and alignment.
If TypeName(myFont) <> "Nothing" Then
myParagraph.AppliedFont = myFont
End If
myParagraph.PointSize = 48
myParagraph.Justification = idJustification.idCenterAlign
Function myGetBounds(myDocument, myPage)
myPageHeight = myDocument.DocumentPreferences.PageHeight
myPageWidth = myDocument.DocumentPreferences.PageWidth
myTop = myPage.MarginPreferences.Top
myLeft = myPage.MarginPreferences.Left
myRight = myPage.MarginPreferences.Right
myBottom = myPage.MarginPreferences.Bottom
myRight = myPageWidth - myRight
myBottom = myPageHeight - myBottom
myGetBounds = Array(myTop, myLeft, myBottom, myRight)
End Function
4. Save the text as a plain text file with the file extension .vbs in the Scripts folder (see “Installing Scripts”
on page 4).
5. Run the new script, by double-clicking the script name in the InDesign Scripts panel.
Constructing a Document
Obviously, our “Hello World!” script is not very useful in your daily work. While you can use an InDesign
script at any point in your production process, we will start by creating scripts that start at the same point
you do—creating new documents, setting page margins, and creating and applying master pages. The
following figure shows the objects with which we will work.
26. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 26
.
document
viewPreferences
horizontalMeasurementUnits
verticalMeasurementUnits
rulerOrigin
masterSpreads.item(0)
pages.item(0)
marginPreferences
top
left
bottom
right
columnCount
columnGutter
In this section, we create one long script by adding short blocks of scripting code. Each block
demonstrates a specific area or task in InDesign scripting. As you enter each block, you can run the script
to see what happens. If you are using AppleScript, you will need to add the text end tell to the end of the
script before you run it, then remove the text before continuing.
Note: The figure above uses the JavaScript version of the scripting terms. For AppleScript, you would add
spaces between words (view preferences, rather than viewPreferences); for VBScript, you
would use an item index starting at 1, rather than 0 (masterSpreads.item(1), rather than
masterSpreads.item(0)).
The objects in the object model generally correspond to the names of controls in the user interface, as
shown in the following diagram (which, again, uses the JavaScript form of the scripting terms):
27. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 27
app.gridPreferences
or
document.gridPreferences
baselineColor
baselineStart
baselineGridRelativeOption
baselineDivision
baselineViewThreshold
gridColor
verticalGridlineDivision
verticalGridSubdivision
horizontalGridlineDivision
horizontalGridSubdivision
gridsInBack
baselineGridShown
documentGridShown
documentGridSnapTo
Setting up Measurement Units and Master Spread Margins
The following script shows how to create a new document and set the margins of the first master spread.
In this section, we show how to build a complex script using simple “building blocks” of scripting code.
Start your script editor and enter the following lines in the scripting language of your choice. After you
enter each block of code, save the script in your Scripts Panel folder (see “Installing Scripts” on page 4).
28. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 28
AppleScript
Either enter the following code in the Script Editor or open the DocumentConstruction.applescript
tutorial script:
tell application "Adobe InDesign CS3"
--Create a new document.
set myDocument to make document
--Set the measurement units and ruler origin.
set horizontal measurement units of view preferences to points
set vertical measurement units of view preferences to points
set ruler origin of view preferences to page origin
--Get a reference to the first master spread.
set myMasterSpread to master spread 1 of myDocument
--Get a reference to the margin preferences of
--the first page in the master spread.
set myMarginPreferences to margin preferences of page 1 of myMasterSpread
--Now set up the page margins and columns.
set left of myMarginPreferences to 84
set top of myMarginPreferences to 70
set right of myMarginPreferences to 70
set bottom of myMarginPreferences to 78
set column count of myMarginPreferences to 3
set column gutter of myMarginPreferences to 14
--Page margins and columns for the right-hand page.
set myMarginPreferences to margin preferences of page 2 of myMasterSpread
set left of myMarginPreferences to 84
set top of myMarginPreferences to 70
set right of myMarginPreferences to 70
set bottom of myMarginPreferences to 78
set column count of myMarginPreferences to 3
set column gutter of myMarginPreferences to 14
29. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 29
JavaScript
Either enter the following code in the ExtendScript Toolkit or open the DocumentConstruction.jsx
tutorial script:
//Create a new document.
var myDocument = app.documents.add();
//Set the measurement units and ruler origin.
myDocument.viewPreferences.horizontalMeasurementUnits =
MeasurementUnits.points;
myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
myDocument.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
//Get a reference to the first master spread.
var myMasterSpread = myDocument.masterSpreads.item(0);
//Get a reference to the margin preferences of the first page in the master
spread.
var myMarginPreferences = myMasterSpread.pages.item(0).marginPreferences;
//Now set up the page margins and columns.
myMarginPreferences.left = 84;
myMarginPreferences.top = 70;
myMarginPreferences.right = 70;
myMarginPreferences.bottom = 78;
myMarginPreferences.columnCount = 3;
myMarginPreferences.columnGutter = 14;
//Page margins and columns for the right-hand page.
var myMarginPreferences = myMasterSpread.pages.item(1).marginPreferences;
myMarginPreferences.left = 84;
myMarginPreferences.top = 70;
myMarginPreferences.right = 70;
myMarginPreferences.bottom = 78;
myMarginPreferences.columnCount = 3;
myMarginPreferences.columnGutter = 14;
30. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 30
VBScript
Either enter the following code in your script or text editor, or open the DocumentConstruction.vbs
tutorial script.
Set myInDesign = CreateObject("InDesign.Application.CS3")
Rem Create a new document.
Set myDocument = myInDesign.Documents.Add()
Rem Set the measurement units and ruler origin.
myDocument.ViewPreferences.HorizontalMeasurementUnits =
idMeasurementUnits.idPoints
myDocument.ViewPreferences.VerticalMeasurementUnits =
idMeasurementUnits.idPoints
myDocument.ViewPreferences.RulerOrigin = idRulerOrigin.idPageOrigin
Rem Get a reference to the first master spread.
Set myMasterSpread = myDocument.MasterSpreads.Item(1)
Rem Get a reference to the margin preferences of the first page in the master
spread.
Set myMarginPreferences = myMasterSpread.Pages.Item(1).MarginPreferences
Rem Now set up the page margins and columns.
myMarginPreferences.Left = 84
myMarginPreferences.Top = 70
myMarginPreferences.Right = 70
myMarginPreferences.Bottom = 78
myMarginPreferences.ColumnCount = 3
myMarginPreferences.ColumnGutter = 14
Rem Page margins and columns for the right-hand page.
Set myMarginPreferences = myMasterSpread.Pages.Item(2).MarginPreferences
myMarginPreferences.Left = 84
myMarginPreferences.Top = 70
myMarginPreferences.Right = 70
myMarginPreferences.Bottom = 78
myMarginPreferences.ColumnCount = 3
myMarginPreferences.ColumnGutter = 14
Adding a Baseline Grid
Now that we have a master spread set up, we will add a baseline grid. Add the following script lines (from
the appropriate language) to the end of the script you created earlier. Again, here is a diagram (with the
scripting terms shown in their JavaScript form):
:
document
gridPreferences
baselineDivision
baselineStart
baselineGridShown
AppleScript
set myGridPreferences to grid preferences
set baseline division of myGridPreferences to 14
set baseline start of myGridPreferences to 70
set baseline grid shown of myGridPreferences to true
31. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 31
JavaScript
var myGridPreferences = myDocument.gridPreferences;
myGridPreferences.baselineDivision = 14;
myGridPreferences.baselineStart = 70;
myGridPreferences.baselineGridShown = true;
VBScript
Set myGridPreferences = myDocument.GridPreferences
myGridPreferences.BaselineDivision = 14
myGridPreferences.BaselineStart = 70
myGridPreferences.BaselineGridShown = True
Adding Master Page Items
Next, we add two text frames to the master pages. These frames will contain the auto-page-number
special character and will be positioned at the bottom of the page.
In the “Hello World” example, we created a text frame and specified its position and size using the
geometric bounds property—an array containing the top, left, bottom, and right coordinates for the
frame. The coordinates correspond to the corners of the frame, just as they would appear in the Control
panel. The geometric bounds are: top = 728, left = 70, bottom = 742, and right = 528, as shown in the
following two figures:
32. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 32
AppleScript
set myLeftPage to page 1 of myMasterSpread
set myRightPage to page 2 of myMasterSpread
tell myLeftPage
set myLeftFooter to make text frame
set geometric bounds of myLeftFooter to {728, 70, 742, 528}
set first baseline offset of text frame preferences of myLeftFooter to
leading offset
set contents of myLeftFooter to auto page number
set point size of character 1 of parent story of myLeftFooter to 11
set leading of character 1 of myLeftFooter to 14
end tell
tell myRightPage
set myRightFooter to make text frame
set geometric bounds of myRightFooter to {728, 84, 742, 542}
set first baseline offset of text frame preferences of myRightFooter to
leading offset
set contents of myRightFooter to auto page number
set point size of character 1 of parent story of myRightFooter to 11
set leading of character 1 of myRightFooter to 14
set justification of character 1 of myRightFooter to right align
end tell
JavaScript
var myMasterSpread = myDocument.masterSpreads.item(0);
var myLeftPage = myMasterSpread.pages.item(0);
var myRightPage = myMasterSpread.pages.item(1);
var myLeftFooter = myLeftPage.textFrames.add();
myLeftFooter.geometricBounds = [728, 70, 742, 528];
myLeftFooter.textFramePreferences.firstBaselineOffset =
FirstBaseline.leadingOffset;
myLeftFooter.contents = SpecialCharacters.autoPageNumber;
myLeftFooter.parentStory.characters.item(0).pointSize = 11;
myLeftFooter.parentStory.characters.item(0).leading = 14;
var myRightFooter = myRightPage.textFrames.add();
myRightFooter.geometricBounds = [728, 84, 742, 542];
myRightFooter.textFramePreferences.firstBaselineOffset =
FirstBaseline.leadingOffset;
myRightFooter.contents = SpecialCharacters.autoPageNumber;
myRightFooter.parentStory.characters.item(0).pointSize = 11;
myRightFooter.parentStory.characters.item(0).leading = 14;
myRightFooter.parentStory.characters.item(0).justification =
Justification.rightAlign;
33. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 33
VBScript
Set myMasterSpread = myDocument.MasterSpreads.Item(1)
Set myLeftPage = myMasterSpread.Pages.Item(1)
Set myRightPage = myMasterSpread.Pages.Item(2)
Set myLeftFooter = myLeftPage.TextFrames.Add
myLeftFooter.GeometricBounds = Array(728, 70, 742, 528)
myLeftFooter.TextFramePreferences.FirstBaselineOffset =
idFirstBaseline.idLeadingOffset
myLeftFooter.Contents = idSpecialCharacters.idAutoPageNumber
myLeftFooter.ParentStory.Characters.Item(1).PointSize = 11
myLeftFooter.ParentStory.Characters.Item(1).Leading = 14
Set myRightFooter = myRightPage.TextFrames.Add()
myRightFooter.GeometricBounds = Array(728, 84, 742, 542)
myRightFooter.TextFramePreferences.FirstBaselineOffset =
idFirstBaseline.idLeadingOffset
myRightFooter.Contents = idSpecialCharacters.idAutoPageNumber
myRightFooter.ParentStory.Characters.Item(1).PointSize = 11
myRightFooter.ParentStory.Characters.Item(1).Leading = 14
myRightFooter.ParentStory.Characters.Item(1).Justification =
idJustification.idRightAlign
Adding Master Text Frames
Next, we add master text frames. The following block diagram shows the objects and properties with
which we will work (the diagram uses the JavaScript form of the scripting terms):
document
masterSpreads.item(0)
pages.item(0)
textFrames.item(0)
textFramePreferences
firstBaselineOffset
textColumnCount
textColumnGutter
geometricBounds
label
nextTextFrame
34. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 34
AppleScript
tell myLeftPage
set myLeftTextFrame to make text frame
set geometric bounds of myLeftTextFrame to {70, 70, 714, 528}
set first baseline offset of text frame preferences of myLeftTextFrame to
leading offset
set text column count of text frame preferences of myLeftTextFrame to 3
set text column gutter of text frame preferences of myLeftTextFrame to 14
--Add a label to make the frame easier to find later on.
set label of myLeftTextFrame to "BodyTextFrame"
end tell
tell myRightPage
set myRightTextFrame to make text frame
set geometric bounds of myRightTextFrame to {70, 84, 714, 542}
set first baseline offset of text frame preferences of myRightTextFrame to
leading offset
set text column count of text frame preferences of myRightTextFrame to 3
set text column gutter of text frame preferences of myRightTextFrame to 14
--Add a label to make the frame easier to find later on.
set label of myRightTextFrame to "BodyTextFrame"
end tell
--Link the two frames using the next text frame property.
set next text frame of myLeftTextFrame to myRightTextFrame
35. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 35
JavaScript
var myLeftPage = myMasterSpread.pages.item(0);
var myRightPage = myMasterSpread.pages.item(1);
var myLeftTextFrame = myLeftPage.textFrames.add();
myLeftTextFrame.geometricBounds = [70, 70, 714, 528];
myLeftTextFrame.textFramePreferences.firstBaselineOffset =
FirstBaseline.leadingOffset;
myLeftTextFrame.textFramePreferences.textColumnCount = 3;
myLeftTextFrame.textFramePreferences.textColumnGutter = 14;
//Add a label to make the frame easier to find later on.
myLeftTextFrame.label = "BodyTextFrame";
var myRightTextFrame = myRightPage.textFrames.add();
myRightTextFrame.geometricBounds = [70, 84, 714, 542];
myRightTextFrame.textFramePreferences.firstBaselineOffset =
FirstBaseline.leadingOffset;
myRightTextFrame.textFramePreferences.textColumnCount = 3;
myRightTextFrame.textFramePreferences.textColumnGutter = 14;
//Add a label to make the frame easier to find later on.
myRightTextFrame.label = "BodyTextFrame";
//Link the two frames using the nextTextFrame property.
myLeftTextFrame.nextTextFrame = myRightTextFrame;
VBScript
Set myLeftTextFrame = myLeftPage.TextFrames.Add
myLeftTextFrame.GeometricBounds = Array(70, 70, 714, 528)
myLeftTextFrame.TextFramePreferences.FirstBaselineOffset =
idFirstBaseline.idLeadingOffset
myLeftTextFrame.TextFramePreferences.TextColumnCount = 3
myLeftTextFrame.TextFramePreferences.TextColumnGutter = 14
Rem Add a label to make the frame easier to find later on.
myLeftTextFrame.Label = "BodyTextFrame"
Set myRightTextFrame = myRightPage.TextFrames.Add
myRightTextFrame.GeometricBounds = Array(70, 84, 714, 542)
myRightTextFrame.TextFramePreferences.FirstBaselineOffset =
idFirstBaseline.idLeadingOffset
myRightTextFrame.TextFramePreferences.TextColumnCount = 3
myRightTextFrame.TextFramePreferences.TextColumnGutter = 14
Rem Add a label to make the frame easier to find later on.
myRightTextFrame.Label = "BodyTextFrame"
Rem Link the two frames using the nextTextFrame property.
myLeftTextFrame.NextTextFrame = myRightTextFrame
Overriding Master Page Items and Adding Text
Next, we override one of the master text frames we created and add text to it. Again, add this script to the
end of the script we have been working on.
36. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 36
AppleScript
tell text frame 1 of page 2 of master spread 1 of myDocument
set myTextFrame to override destination page page 1 of myDocument
end tell
--Add text by setting the contents of an insertion point to a string.
--In AppleScript, "return" is a return character.
set contents of insertion point 1 of myTextFrame to "Headline!" & return
JavaScript
var myTextFrame =
myDocument.masterSpreads.item(0).pages.item(1).textFrames.item(0).override(my
Document.pages.item(0));
//Add text by setting the contents of an insertion point to a string.
//In JavaScript, "r" is a return character.
myTextFrame.insertionPoints.item(0).contents = "Headline!r";
VBScript
Set myTextFrame =
myDocument.MasterSpreads.Item(1).Pages.Item(2).TextFrames.Item(1).Override(my
Document.Pages.Item(1))
Rem Add text by setting the contents of an insertion point to a string.
Rem In VBScript, vbCr is a return character.
myTextFrame.InsertionPoints.Item(1).Contents = "Headline!" & vbCr
Adding and Applying a Paragraph Style
Our headline looks plain, so we will format it using a paragraph style. To do that, we must create the
paragraph style. The following diagram shows the objects and properties we will work with (again, the text
in this diagram uses the JavaScript form of the scripting terms):
document
paragraphStyles
paragraphStyle
appliedFont
fontStyle
pointSize
spaceBefore
spaceAfter
fillColor
37. Adobe InDesign CS3 Scripting Tutorial Constructing a Document 37
AppleScript
--First, check to see if the paragraph style already exists.
try
set myParagraphStyle to paragraph style "Heading 1" of myDocument
on error
--The paragraph style did not exist, so create it.
tell myDocument
set myParagraphStyle to make paragraph style with properties
{name:"Heading 1"}
end tell
end try
--We'll need to create a color. Check to see if the color already exists.
try
set myColor to color "Red"
on error
--The color did not exist, so create it.
set myColor to make color with properties {name:"Red", model:process, color
value:{0, 100, 100, 0}}
end try
--Now set the formatting of the paragraph style.
set applied font of myParagraphStyle to "Arial"
set font style of myParagraphStyle to "Bold"
set point size of myParagraphStyle to 24
set space after of myParagraphStyle to 24
set space before of myParagraphStyle to 24
set fill color of myParagraphStyle to color "Red" of myDocument
--Apply the style to the paragraph.
tell paragraph 1 of myTextFrame to apply paragraph style using myParagraphStyle
with clearing overrides
--You could also use:
--set applied paragraph style of paragraph 1 of myTextFrame to myParagraphStyle
JavaScript
var myParagraphStyle = myDocument.paragraphStyles.item("Heading 1");
try {
var myName = myParagraphStyle.name;
}
catch (myError){
//The paragraph style did not exist, so create it.
myParagraphStyle = myDocument.paragraphStyles.add({name:"Heading 1"});
}
//We'll need to create a color. Check to see if the color already exists.
var myColor = myDocument.colors.item("Red");
try {
myName = myColor.name;
}
catch (myError){
//The color did not exist, so create it.
myColor = myDocument.colors.add({name:"Red", model:ColorModel.process,
colorValue:[0,100,100,0]});
}