A sample “afterNew” eventListener. Adobe InCopy CS6

Add to My manuals
108 Pages

advertisement

A sample “afterNew” eventListener. Adobe InCopy CS6 | Manualzz

Events A sample “afterNew” eventListener 83

The following script is the one referred to by the preceding script. The file reference in the preceding script must match the location of this script on your disk. For the complete script, see

GetEventInfo.vbs

.

Rem GetEventInfo.vbs

Rem An InCopy CS6 VBScript

Rem

Rem Displays information about an Event object; called from an EventListener.

main evt

Function main(myEvent) myString = "Handling Event: " & myEvent.EventType

myString = myString & vbCr & vbCr & "Target: " & myEvent.Target & " " & myEvent.Target.Name

myString = myString & vbCr & "Current: " & myEvent.CurrentTarget & " " & myEvent.CurrentTarget.Name

myString = myString & vbCr & vbCr & "Phase: " & myGetPhaseName(myEvent.EventPhase) myString = myString & vbCr & "Captures: " & myEvent.Captures

myString = myString & vbCr & "Bubbles: " & myEvent.Bubbles

myString = myString & vbCr & vbCr & "Cancelable: " & myEvent.Cancelable

myString = myString & vbCr & "Stopped: " & myEvent.PropagationStopped

myString = myString & vbCr & "Canceled: " & myEvent.DefaultPrevented

myString = myString & vbCr & vbCr & "Time: " & myEvent.TimeStamp

MsgBox myString, vbOKOnly, "Event Details" end function

Rem Function returns a string corresponding to the event phase enumeration.

Function myGetPhaseName(myEventPhase)

Select Case myEventPhase

Case idEventPhases.idAtTarget

myPhaseName = "At Target"

Case idEventPhases.idBubblingPhase

myPhaseName = "Bubbling"

Case idEventPhases.idCapturingPhase

myPhaseName = "Capturing"

Case idEventPhases.idDone

myPhaseName = "Done"

Case idEventPhases.idNotDispatching

myPhaseName = "Not Dispatching" end select myGetPhaseName = myPhaseName

End Function

The following sample script shows how to turn off all

EventListeners

for the application object. For the complete script, see EventListenersOff.

Rem EventListenersOff.vbs

Rem An InCopy CS6 JavaScript

Rem

Rem Removes all event listeners from the application.

Set myInCopy = CreateObject("InCopy.Application")

For myCounter = 1 To myInCopy.EventListeners.Count

myInCopy.EventListeners.Item(1).Delete

Next

A sample “afterNew” eventListener

The afterNew

event provides a convenient place to add information to the document, like user name, document creation date, copyright information, and other job-tracking information. The following sample script shows how to add this sort of information to document metadata (also known as file info or XMP information). For the complete script listing, refer to the AfterNew tutorial script.

Events A sample “afterNew” eventListener 84

Set myInCopy = CreateObject("InCopy.Application")

Set myEventListener = myInCopy.EventListeners.Add("afterNew",

"c:\AfterNewHandler.vbs")

The following script is the one referred to by the preceding script. The file reference in the preceding script must match the location of this script on your disk. For the complete script, see

AfterNewHandler.vbs

.

Rem AfterNewHandler.vbs

Rem An InCopy CS6 VBScript

Rem

Rem Adds metadata to a new document.

myAddMetadata evt

Function myAddMetadata(myEvent)

Set myInCopy = CreateObject("InCopy.Application")

Set myDocument = myInCopy.Documents.Item(1) myInCopy.UserName = "Adobe"

With myDocument.MetadataPreferences

.Author = "Adobe Systems"

.Description = "This is a sample document with XMP metadata." & vbCr & "Created: " + myEvent.TimeStamp

End With

End Function

advertisement

Key Features

  • Seamless collaboration between copywriters and designers
  • Copyflow workspace tailored for editorial workflows
  • Effortless integration with InDesign for copy placement and editing
  • Comprehensive text editing and styling capabilities
  • Efficient handling of long-form and complex documents
  • Streamlined copyfitting and typesetting features
  • Advanced typography controls for precise text formatting

Related manuals

Frequently Answers and Questions

Can InCopy be used independently of InDesign?
Yes, InCopy can be used as a standalone application for text editing and styling.
How does InCopy integrate with InDesign?
InCopy seamlessly integrates with InDesign, allowing copywriters to place and edit copy within InDesign page layouts.
What are the benefits of using InCopy for editorial workflows?
InCopy provides a specialized copyflow workspace tailored for editorial workflows, ensuring efficient and collaborative copywriting and editing.
Does InCopy support advanced typography features?
Yes, InCopy offers advanced typography controls for precise text formatting, giving you complete control over the appearance of your text.
Download PDF

advertisement

Table of contents