-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed.
“[-prefix-free is] fantastic, top-notch work! Thank you for creating and sharing it.”
— Eric Meyer
<link>
or <style>
elements and adds a vendor prefix where neededstyle
attribute and adds a vendor prefix where needed<link>
or <style>
elements, style
attribute changes and CSSOM changes (requires plugin).css()
method get and set unprefixed properties (requires plugin)@import
-ed files is not supportedstyle
attribute) won’t work in IE and Firefox < 3.6. Properties as well in Firefox < 3.6.Check this page’s stylesheet ;-)
You can also visit the Test Drive page, type in any code you want and check out how it would get prefixed for the current browser.
Just include prefixfree.js
anywhere in your page. It is recommended to put it right after the stylesheets, to minimize FOUC
That’s it, you’re done!
The target browser support is IE9+, Opera 10+, Firefox 3.5+, Safari 4+ and Chrome.
If it doesn’t work in any of those, it’s a bug so please report it. Just before you do, please make sure that it’s not because the browser doesn’t support a CSS3 feature at all, even with a prefix.
In older browsers like IE8, nothing will break, just properties won’t get prefixed. Which wouldn’t be useful anyway as IE8 doesn’t support much CSS3 ;)
Test the prefixing that -prefix-free would do for this browser, by writing some CSS below:
Properties/values etc that already have a prefix won’t be altered. However, if you use the unprefixed property/value etc after the prefixed properties, you might run into issue #16.
For those cases, -prefix-free adds a class on the root element (the <html>
element in HTML) with the same name as the current prefix. So for example, to solve the problem presented in the above issue, you could do:
.myselector { transform: rotate(15deg); } .-webkit- .myselector { transform: rotate(15deg) rotateX(0); }
It’t not ideal, but it’s a solution, until a more intuitive way to deal with these cases is added in -prefix-free.
Please note that in unsupported browsers like IE8, no such class will be added.
Firefox (and IE?) natively support local XHR, so -prefix-free will work fine locally with them.
To enable local XHR for Chrome, you need to run it with the flag --allow-file-access-from-files
.
To enable local XHR for Opera, you have to go to opera:config#UserPrefs|AllowFileXMLHttpRequest, check that option and Save.
A server side script would need to add all prefixes, making the size of the CSS file considerably larger. Also, it should maintain a list of features that need prefixes, or add them all and unnecessarily bloat the stylesheet. -prefix-free automatically detects what needs a prefix and what doesn’t.
Also, a common argument against doing this on the client side, is that it makes the design rely on JavaScript. However, that is completely false: If JS is disabled, only some of the CSS3 won’t show. But if your design relies on CSS3 to be functional, you have bigger problems bro.
You can read some more about this in my recent CSS Tricks interview
But every solution has its own pros and cons. If you would feel more comfortable with a server-side script, use that and don’t troll me please. Remember: nobody forced you to use -prefix-free. KTHXBAI ☺
Extra code on top of -prefix-free that makes it more flexible, integrates it with different APIs etc
Originally a part of -prefix-free, it’s now a separate plugin. It makes -prefix-free take care of:
<link>
and <style>
added to the document afterwardsstyle
attribute added to the document afterwardsstyle
attribute changes through setAttribute()
(except in Webkit)element.style.transform = 'rotate(10deg)';
style
attribute modifications will not work in Webkitelement.style.transform = 'rotate(5deg)';will not work in Chrome (reading will)
Get the Dynamic DOM plugin now:
A tiny plugin (I didn’t even bother minifying it as it’s so small) that lets you set/get unprefixed CSS properties through jQuery's .css
method.
Get the jQuery plugin now:


- NAME
- open - Open a file-based or command pipeline channel
- SYNOPSIS
- open fileName
- open fileName access
- open fileName access permissions
- DESCRIPTION
- r
- r+
- w
- w+
- a
- a+
- RDONLY
- WRONLY
- RDWR
- APPEND
- CREAT
- EXCL
- NOCTTY
- NONBLOCK
- TRUNC
- COMMAND PIPELINES
- SERIAL COMMUNICATIONS
- -mode baud,parity,data,stop
- -handshake type
- -queue
- -timeout msec
- -ttycontrol {signal boolean signal boolean ...}
- -ttystatus
- -xchar {xonChar xoffChar}
- -pollinterval msec
- -sysbuffer inSize
- -sysbuffer {inSize outSize}
- -lasterror
- SERIAL PORT SIGNALS
- TXD(output)
- RXD(input)
- RTS(output)
- CTS(input)
- DTR(output)
- DSR(input)
- DCD(input)
- RI(input)
- BREAK
- ERROR CODES (Windows only)
- RXOVER
- TXFULL
- OVERRUN
- RXPARITY
- FRAME
- BREAK
- PORTABILITY ISSUES
- Windows (all versions)
- Windows NT
- Windows 95
- Macintosh
- Unix
- EXAMPLE
- SEE ALSO
- KEYWORDS
open - Open a file-based or command pipeline channel
open fileName
open fileName access
open fileName access permissions
This command opens a file, serial port, or command pipeline and returns a
channel identifier that may be used in future invocations of commands like
read, puts, and close.
If the first character of fileName is not | then
the command opens a file:
fileName gives the name of the file to open, and it must conform to the
conventions described in the filename manual entry.
The access argument, if present, indicates the way in which the file
(or command pipeline) is to be accessed.
In the first form access may have any of the following values:
- r
-
Open the file for reading only; the file must already exist. This is the
default value if access is not specified.
- r+
-
Open the file for both reading and writing; the file must
already exist.
- w
-
Open the file for writing only. Truncate it if it exists. If it doesn't
exist, create a new file.
- w+
-
Open the file for reading and writing. Truncate it if it exists.
If it doesn't exist, create a new file.
- a
-
Open the file for writing only. If the file doesn't exist,
create a new empty file.
Set the file pointer to the end of the file prior to each write.
- a+
-
Open the file for reading and writing. If the file doesn't exist,
create a new empty file.
Set the initial access position to the end of the file.
In the second form, access consists of a list of any of the
following flags, all of which have the standard POSIX meanings.
One of the flags must be either RDONLY, WRONLY or RDWR.
- RDONLY
-
Open the file for reading only.
- WRONLY
-
Open the file for writing only.
- RDWR
-
Open the file for both reading and writing.
- APPEND
-
Set the file pointer to the end of the file prior to each write.
- CREAT
-
Create the file if it doesn't already exist (without this flag it
is an error for the file not to exist).
- EXCL
-
If CREAT is also specified, an error is returned if the
file already exists.
- NOCTTY
-
If the file is a terminal device, this flag prevents the file from
becoming the controlling terminal of the process.
- NONBLOCK
-
Prevents the process from blocking while opening the file, and
possibly in subsequent I/O operations. The exact behavior of
this flag is system- and device-dependent; its use is discouraged
(it is better to use the fconfigure command to put a file
in nonblocking mode).
For details refer to your system documentation on the open system
call's O_NONBLOCK flag.
- TRUNC
-
If the file exists it is truncated to zero length.
If a new file is created as part of opening it, permissions
(an integer) is used to set the permissions for the new file in
conjunction with the process's file mode creation mask.
Permissions defaults to 0666.
Note that if you are going to be reading or writing binary data from
the channel created by this command, you should use the
fconfigure command to change the -translation option of
the channel to binary before transferring any binary data. This
is in contrast to the ``b'' character passed as part of the equivalent
of the access parameter to some versions of the C library
fopen() function.
If the first character of fileName is ``|'' then the
remaining characters of fileName are treated as a list of arguments
that describe a command pipeline to invoke, in the same style as the
arguments for exec.
In this case, the channel identifier returned by open may be used
to write to the command's input pipe or read from its output pipe,
depending on the value of access.
If write-only access is used (e.g. access is w), then
standard output for the pipeline is directed to the current standard
output unless overridden by the command.
If read-only access is used (e.g. access is r),
standard input for the pipeline is taken from the current standard
input unless overridden by the command.
The id of the spawned process is accessible through the pid
command, using the channel id returned by open as argument.
If the command (or one of the commands) executed in the command
pipeline returns an error (according to the definition in exec),
a Tcl error is generated when close is called on the channel
unless the pipeline is in non-blocking mode then no exit status is
returned (a silent close with -blocking 0).
It is often useful to use the fileevent command with pipelines
so other processing may happen at the same time as running the command
in the background.
If fileName refers to a serial port, then the specified serial port
is opened and initialized in a platform-dependent manner. Acceptable
values for the fileName to use to open a serial port are described in
the PORTABILITY ISSUES section.
The fconfigure command can be used to query and set additional
configuration options specific to serial ports (where supported):
- -mode baud,parity,data,stop
-
This option is a set of 4 comma-separated values: the baud rate, parity,
number of data bits, and number of stop bits for this serial port. The
baud rate is a simple integer that specifies the connection speed.
Parity is one of the following letters: n, o, e,
m, s; respectively signifying the parity options of ``none'',
``odd'', ``even'', ``mark'', or ``space''. Data is the number of
data bits and should be an integer from 5 to 8, while stop is the
number of stop bits and should be the integer 1 or 2.
- -handshake type
-
(Windows and Unix). This option is used to setup automatic handshake
control. Note that not all handshake types maybe supported by your operating
system. The type parameter is case-independent.
If type is none then any handshake is switched off.
rtscts activates hardware handshake. Hardware handshake signals
are described below.
For software handshake xonxoff the handshake characters can be redefined
with -xchar.
An additional hardware handshake dtrdsr is available only under Windows.
There is no default handshake configuration, the initial value depends
on your operating system settings.
The -handshake option cannot be queried.
- -queue
-
(Windows and Unix). The -queue option can only be queried.
It returns a list of two integers representing the current number
of bytes in the input and output queue respectively.
- -timeout msec
-
(Windows and Unix). This option is used to set the timeout for blocking
read operations. It specifies the maximum interval between the
reception of two bytes in milliseconds.
For Unix systems the granularity is 100 milliseconds.
The -timeout option does not affect write operations or
nonblocking reads.
This option cannot be queried.
- -ttycontrol {signal boolean signal boolean ...}
-
(Windows and Unix). This option is used to setup the handshake
output lines (see below) permanently or to send a BREAK over the serial line.
The signal names are case-independent.
{RTS 1 DTR 0} sets the RTS output to high and the DTR output to low.
The BREAK condition (see below) is enabled and disabled with {BREAK 1} and
{BREAK 0} respectively.
It's not a good idea to change the RTS (or DTR) signal
with active hardware handshake rtscts (or dtrdsr).
The result is unpredictable.
The -ttycontrol option cannot be queried.
- -ttystatus
-
(Windows and Unix). The -ttystatus option can only be
queried. It returns the current modem status and handshake input signals
(see below).
The result is a list of signal,value pairs with a fixed order,
e.g. {CTS 1 DSR 0 RING 1 DCD 0}.
The signal names are returned upper case.
- -xchar {xonChar xoffChar}
-
(Windows and Unix). This option is used to query or change the software
handshake characters. Normally the operating system default should be
DC1 (0x11) and DC3 (0x13) representing the ASCII standard
XON and XOFF characters.
- -pollinterval msec
-
(Windows only). This option is used to set the maximum time between
polling for fileevents.
This affects the time interval between checking for events throughout the Tcl
interpreter (the smallest value always wins). Use this option only if
you want to poll the serial port more or less often than 10 msec
(the default).
- -sysbuffer inSize
-
- -sysbuffer {inSize outSize}
-
(Windows only). This option is used to change the size of Windows
system buffers for a serial channel. Especially at higher communication
rates the default input buffer size of 4096 bytes can overrun
for latent systems. The first form specifies the input buffer size,
in the second form both input and output buffers are defined.
- -lasterror
-
(Windows only). This option is query only.
In case of a serial communication error, read or puts
returns a general Tcl file I/O error.
fconfigure -lasterror can be called to get a list of error details.
See below for an explanation of the various error codes.
RS-232 is the most commonly used standard electrical interface for serial
communications. A negative voltage (-3V..-12V) define a mark (on=1) bit and
a positive voltage (+3..+12V) define a space (off=0) bit (RS-232C). The
following signals are specified for incoming and outgoing data, status
lines and handshaking. Here we are using the terms workstation for
your computer and modem for the external device, because some signal
names (DCD, RI) come from modems. Of course your external device may use
these signal lines for other purposes.
- TXD(output)
-
Transmitted Data: Outgoing serial data.
- RXD(input)
-
Received Data:Incoming serial data.
- RTS(output)
-
Request To Send: This hardware handshake line informs the modem that
your workstation is ready to receive data. Your workstation may
automatically reset this signal to indicate that the input buffer is full.
- CTS(input)
-
Clear To Send: The complement to RTS. Indicates that the modem is
ready to receive data.
- DTR(output)
-
Data Terminal Ready: This signal tells the modem that the workstation
is ready to establish a link. DTR is often enabled automatically whenever a
serial port is opened.
- DSR(input)
-
Data Set Ready: The complement to DTR. Tells the workstation that the
modem is ready to establish a link.
- DCD(input)
-
Data Carrier Detect: This line becomes active when a modem detects
a "Carrier" signal.
- RI(input)
-
Ring Indicator: Goes active when the modem detects an incoming call.
- BREAK
-
A BREAK condition is not a hardware signal line, but a logical zero on the
TXD or RXD lines for a long period of time, usually 250 to 500
milliseconds. Normally a receive or transmit data signal stays at the mark
(on=1) voltage until the next character is transferred. A BREAK is sometimes
used to reset the communications line or change the operating mode of
communications hardware.
A lot of different errors may occur during serial read operations or during
event polling in background. The external device may have been switched
off, the data lines may be noisy, system buffers may overrun or your mode
settings may be wrong. That's why a reliable software should always
catch serial read operations. In cases of an error Tcl returns a
general file I/O error. Then fconfigure -lasterror may help to
locate the problem. The following error codes may be returned.
- RXOVER
-
Windows input buffer overrun. The data comes faster than your scripts reads
it or your system is overloaded. Use fconfigure -sysbuffer to avoid a
temporary bottleneck and/or make your script faster.
- TXFULL
-
Windows output buffer overrun. Complement to RXOVER. This error should
practically not happen, because Tcl cares about the output buffer status.
- OVERRUN
-
UART buffer overrun (hardware) with data lost.
The data comes faster than the system driver receives it.
Check your advanced serial port settings to enable the FIFO (16550) buffer
and/or setup a lower(1) interrupt threshold value.
- RXPARITY
-
A parity error has been detected by your UART.
Wrong parity settings with fconfigure -mode or a noisy data line (RXD)
may cause this error.
- FRAME
-
A stop-bit error has been detected by your UART.
Wrong mode settings with fconfigure -mode or a noisy data line (RXD)
may cause this error.
- BREAK
-
A BREAK condition has been detected by your UART (see above).
- Windows (all versions)
-
Valid values for fileName to open a serial port are of the form
comX:, where X is a number, generally from 1 to 4.
This notation only works for serial ports from 1 to 9, if the system
happens to have more than four. An attempt to open a serial port that
does not exist or has a number greater than 9 will fail. An alternate
form of opening serial ports is to use the filename \\.\comX,
where X is any number that corresponds to a serial port; please note
that this method is considerably slower on Windows 95 and Windows 98.
- Windows NT
-
When running Tcl interactively, there may be some strange interactions
between the real console, if one is present, and a command pipeline that uses
standard input or output. If a command pipeline is opened for reading, some
of the lines entered at the console will be sent to the command pipeline and
some will be sent to the Tcl evaluator. If a command pipeline is opened for
writing, keystrokes entered into the console are not visible until the
pipe is closed. This behavior occurs whether the command pipeline is
executing 16-bit or 32-bit applications. These problems only occur because
both Tcl and the child application are competing for the console at
the same time. If the command pipeline is started from a script, so that Tcl
is not accessing the console, or if the command pipeline does not use
standard input or output, but is redirected from or to a file, then the
above problems do not occur.
- Windows 95
-
A command pipeline that executes a 16-bit DOS application cannot be opened
for both reading and writing, since 16-bit DOS applications that receive
standard input from a pipe and send standard output to a pipe run
synchronously. Command pipelines that do not execute 16-bit DOS
applications run asynchronously and can be opened for both reading and
writing.
When running Tcl interactively, there may be some strange interactions
between the real console, if one is present, and a command pipeline that uses
standard input or output. If a command pipeline is opened for reading from
a 32-bit application, some of the keystrokes entered at the console will be
sent to the command pipeline and some will be sent to the Tcl evaluator. If
a command pipeline is opened for writing to a 32-bit application, no output
is visible on the console until the pipe is closed. These problems only
occur because both Tcl and the child application are competing for the
console at the same time. If the command pipeline is started from a script,
so that Tcl is not accessing the console, or if the command pipeline does
not use standard input or output, but is redirected from or to a file, then
the above problems do not occur.
Whether or not Tcl is running interactively, if a command pipeline is opened
for reading from a 16-bit DOS application, the call to open will not
return until end-of-file has been received from the command pipeline's
standard output. If a command pipeline is opened for writing to a 16-bit DOS
application, no data will be sent to the command pipeline's standard output
until the pipe is actually closed. This problem occurs because 16-bit DOS
applications are run synchronously, as described above.
- Macintosh
-
Opening a serial port is not currently implemented under Macintosh.
Opening a command pipeline is not supported under Macintosh, since
applications do not support the concept of standard input or output.
- Unix
-
Valid values for fileName to open a serial port are generally of the
form /dev/ttyX, where X is a or b, but the name
of any pseudo-file that maps to a serial port may be used.
Advanced configuration options are only supported for serial ports
when Tcl is built to use the POSIX serial interface.
When running Tcl interactively, there may be some strange interactions
between the console, if one is present, and a command pipeline that uses
standard input. If a command pipeline is opened for reading, some
of the lines entered at the console will be sent to the command pipeline and
some will be sent to the Tcl evaluator. This problem only occurs because
both Tcl and the child application are competing for the console at the
same time. If the command pipeline is started from a script, so that Tcl is
not accessing the console, or if the command pipeline does not use standard
input, but is redirected from a file, then the above problem does not occur.
See the PORTABILITY ISSUES section of the exec command for additional
information not specific to command pipelines about executing
applications on the various platforms
Open a command pipeline and catch any errors:
set fl [open "| ls this_file_does_not_exist"]
set data [read $fl]
if {[catch {close $fl} err]} {
puts "ls command failed: $err"
}
file, close, filename, fconfigure, gets, read, puts, exec, pid, fopen
access mode, append, create, file, non-blocking, open, permissions, pipeline, process, serial
Copyright © 1993 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.
Copyright © 1995-1997 Roger E. Critchlow Jr.


Package containing objects that orchestrate this application problem set. This package represents a default implementation of the blackboard framework. @since 1.0


Jun 30, 2010 - PicoContainer 2.11.1 released (316K jar)
Changes (versus 2.11):
- Life-cycles and CompositeInjection play better now. See PICO-371
- Setter Injection and Log4JComponentMonitor play better now. See PICO-372
Jun 27, 2009 - PicoContainer-Web 2.5 released
See the news page for it
Jun 27, 2010 - PicoContainer 2.11 released (312K jar)
New (since 2.10.2):
- Alternate 'debug' version of PicoContainer made that does not have shaded Paranamer which in turn uses real ASM. Both those are transitive deps now
Changes (versus 2.10.2):
- Fix HiddenImplementation to cache delegate per instance not per invocation reported by Chris Floersch
- JNDI fixes. See PICO-370
- Rare ArrayIndexOutOfBoundsException when adding components fixedPICO-367
- Getters added for 'name' and 'lifecyclestate' for containers.
- PicoBuilder instances are reusable now.
- Better support for handling ComponentAdapters while flushing instances.
- Some component monitors vulnerable to race conditions (now fixed)
Feb 25, 2010 - PicoContainer 2.10.2 released (308K jar)
Changes (versus 2.10.1):
- A fix of a NullPointerException issue when using ProviderAdapter
Feb 23, 2010 - PicoContainer 2.10.1 released (308K jar)
Changes (versus 2.10):
- Further generics work on ComponentAdapter signature as per PICO-369
Feb 21, 2010 - PicoContainer 2.10 released (308K jar)
New (since 2.9):
- String Converters are now overridable and can be leveraged from parent containers if not specified in a child
- Named Method Injection
- @Named from JSR 330 (@Inject) now supported.
Changes (versus 2.9):
- FactoryInjectors issue with 'into' being unspecified fixedPICO-368
- Provided instances can now participate in lifecycles
Nov 2, 2009 - PicoContainer 2.9 released (299K jar)
New (since 2.8.3):
- Lifecycle strategy allows for concept of lazy starting. This means components are started at first access. PICO-355
- Regex collecting of components for injection, or just on getComponent() now built in.
Changes (versus 2.8.3):
- Purposeful injection of a Null parameter fixed PICO-364
- Small performance improvements for getAdapter/getInstance
- Dependencies for Log4J and SLF4J moved forward
- Paranamer upgraded to 2.1
- Exception in Lifecycle methods bug fixed PICO-363
- PicoBuilder able to do more with Lifecycle strategies
- Factory Injection improved with an 'InjectInto' type PICO-358
Jun 18, 2009 - PicoContainer 2.8.3 released (299K jar)
New (since 2.8.2):
- DefaultPicoContainer opened up a to facilitate rudimentary lazy lifecycle
Changes (versus 2.8.2):
- Providers not passing on exceptions bug fixed: PICO-357
May 27, 2009 - PicoContainer 2.8.2 released (298K jar)
Changes (versus 2.8.1):
- Constructor Injection is slightly faster for second/subsequent injections and for multi-constructor components
- More optimized Paranamer usage and upgrade to 2.0
- Generic Collections more consistent between Setter and Constructor injection PICO-354
May 20, 2009 - PicoContainer 2.8.1 released (298K jar)
New (since 2.8):
- Reinjection calls can use cached results for method invocations
Changes (versus 2.8):
- Constructor Injection is slightly faster for second/subsequent injections and for multi-constructor components
- Compatibility with Google's AppEngine
- Paranamer upgraded to 1.5
- A couple of bugs fixed PICO-352 and 353
Feb 26, 2009 - PicoContainer-Web 2.3 released
See the news page for it
Feb 26, 2009 - PicoContainer 2.8 released (286K jar)
New (since 2.7):
- Automatic type conversion for named parameters (from String)
Changes (versus 2.7):
- JSR 250 annotations themselves (@PostConstruct etc) not included in the Jar anymore
- Paranamer upgraded to 1.3 and PicoContainer's usage of it changed to better caching and fallback model
- Improved handling of Constant Parameters for class instances
- Adapter.findAdapterofType() null handling improved
Jan 20, 2009 - PicoContainer 2.7 released (278K jar)
New (since 2.6):
- Provider added as a type of Injector. Subclasses of this supply one method called provide that takes
dependencies and returns an instance of the type it is trying to provide
- ComponentMonitor: new method newBehavior
- ReflectionMethodInjection: new annotation @Nullable allows for individual parameters to be null
- Guarding behaviour : before components are injected, another seeming unrelated can be injected too and veto if it sees fit
Changes (versus 2.6):
- Reinjection changed to allow access to the result in the reinjection method invocation
- Method decorateComponentInstance on Injector changed to have a return value
- Scoped components stored in ThreadLocal can now can honor lifecycle concepts reliably
- ComponentMonitor: newInjectorFactory method renamed to newInjector
- Fix of issue where ImplementationHiding and Caching together on a component in threadlocal
- AnnotatedFieldInjection changed to traverse into parent classes for annotated fields to inject into
- Paranamer (included in PicoContainer jar) has had a couple of bugs fixed.
- Issued 343 fixed where generic collections were not not being injected correctly
October 14, 2008 - PicoContainer 2.6 released (265K jar)
New (since 2.5.1):
- CompositeLifecycleStrategy supports a mix of LifecycleStrategies in one container tree
- Method Injection changed to also allow a specific reflection method to be implicated
- Reinjection added to allow components to be injected into a second time (reflection method injection only)
Changes (versus 2.5.1):
- Permissions fix for AdaptingInjection
Aug 14, 2008 - PicoContainer 2.5.1 released (255K jar)
Changes (versus 2.5):
- makeChildContainer passes componentMonitor to the child container.
July 25, 2008 - PicoContainer 2.5 released (255K jar)
New (since 2.4):
- Circular dependencies, while always supported via the implementation hiding behavior are now supported
explicitly for individual components
- PicoBuilder improved in that it can add child containers to their parents if wanted. Refer
PicoBuilder.addChildToParent()
- Components can now declare generic collections as dependencies to be Injected. It works the same was as an Array
of the type in question always did.
- Concrete extensions of generic components can satisfy dependencies now. This is a way of beating type
erasure.
Changes (versus 2.4):
- ConsoleComponentMonitor does need to be final, thus is not now.
- Attempts to chain a series of MutablePicoContainer.as() statements are blocked now. Instead users are directed
towards the varargs feature of the same method.
July 02, 2008
PicoContainer Web, Script, Persistence and Logging 2.x released
See links above for respective news pages
June 26, 2008 - PicoContainer 2.4 released (253K jar)
New (since 2.3):
- DefaultClassLoadingPicoContainer added. Components can now be referenced in different classloaders and by class
name. This was formerly DefaultNanoContainer
- Locking behaviors are now characterizable as LOCK and NO_LOCK
- Synchronizing behaviors are now characterizable as SYNCHRONIZE and NO_SYNCHRONIZE
- Pooling behaviors are now characterizable as NO_POOL and POOL
- HotSwapping behaviors are now characterizable as HOT_SWAP and NO_HOT_SWAP
Changes (versus 2.3):
- Visitor for trees of PicoContainers, can issue a halt instruction now to stop the visitation early
- PICO-0316 fixed, whereby iterative injectors would not always find the dependencies to inject, when there were
present
- AsmHiddenImplementation behavior in Gems replaces by HiddenImplementation
- CommandLinePicoContainer replaces by CommandLineArgumentsPicoContainer (now deprecated)
- ReflectionLifecycleStrategy can be subclassed now
- PICO-0314 fixed - StartableLifecycleStrategy can now have custom Disposable alternate classes correctly
- PICO-0303 fixed - ReflectionLifecycleStrategy was not bubbling lifecycle exceptions correctly
May 24, 2008 - PicoContainer 2.3 released (241K jar)
New (since 2.2):
- FactoryInjector implementations for Log4J, Commons-logging, Java-Logging and SL4FJ
- JSR-250 compatible (@PreDestroy and @PostConstruct) lifecycle strategy
- Slf4j based component monitor
- Visitor for component factories (PICO-221)
- Thread local Storing behavior now has a mechanism to report the store size
Changes (versus 2.2):
- Implementation-hiding Behavior has a bug PICO-310 that has been fixed
- FactoryInjection bug fixed - PICO-311
- Embedded Paranamer now upgraded to 1.1.3
- Some of the monitors are now serializable when they were not formerly
May 9, 2008 - PicoContainer 2.2 released (224K jar)
New (since 2.1):
- A new TieringPicoContainer that when used in a container tree, forbids children from seeking dependencies from
their grandparents (they can only seek such from their parents)
- A new ReusablePicoContainer that is 2.5x faster for some niche usages where you are repeatedly discarding a
container and then repopulating it (Gems)
- NamedFieldInjection allows named fields to be injected into (per component) - use when AnnotatedFieldInjection
is not what you want
- TypedFieldInjection allows fields of a specified type to be injected into (per component) - use when
AnnotatedFieldInjection is not what you want
- CompositeInjection allows a very custom setup of what injection-types you want your instance to support. Use
when speed of execution is of the essence and AdaptiveInjection is not
right for you.
- Decorating (behavior factory) - do something to a component instance immediately after its instantiation (and
formal injection)
- FactoryAdapter - Allows for a custom instance to be injected into a component. E.g. 'new Logger(Foo.class)' for
a Logger type and a Foo instance being the injectee
Changes (versus 2.1):
- Teams embedding PicoContainer and (completely hiding it from user communities) can extend
StartableLifecycleStrategy and provide their own Startable interface (was buggy)
Mar 31, 2008 - PicoContainer 2.1 released (194K jar)
New (since 2.0):
- A new ComponentMonitor method to allow allow for better mocking of select components during unit testing.
Jan 19, 2008 - PicoContainer 2.0 released (190K jar)
New (since 2.0-beta-2):
- Binding Annotations support (disambiguation)
- Newer and rewritten properties backed containers
- Parameter names can be leveraged for all relevant types of injection
Changes (versus 2.0-beta-2):
- Yet More Java5 generics
- Build moved to JUnit 4.x and JMock 2.x (does not affect users of PicoContainer)
- Built-in parameter name access, as opposed jar dependency
August 26, 2007 - PicoContainer 2.0 beta 2 released (152K jar)
New (versus 2.0-beta-1):
- Rudimentary AOP capability for components built in
- Method Injection (one method post-construction with multiple arguments)
- Automatic JNDI exposure
- Multi Injection (Setter and after Constructor injection)
- Store behavior (can extract/replace component store per thread)
- Automatic components (instantiate irrespective of need)
- Reentrant-Lock version of Synchronizing behavior
Changes (versus 2.0-beta-1):
- Better Java5 generics
- Renames of behaviors and injectors to more verb-like style
- Startable interface more easily overridden to own choice
July 15, 2007 - PicoContainer 2.0 BETA-1 released (128K jar)
New:
- Properties for components as they are added to containers makes for increased flexibility
- Field and Method annotation types of injection in addition to traditional Constructor (recommended) and Setter
types
- Parameters names for constructors can now drive otherwise ambiguous injections, as well as configuration
- Large sets of configuration can be taken from properties files and command line arguments
- PicoBuilder to make a container with desired behavior.
Changes:
- Java 5 style (use of generics, varargs, among others)
- Large scale Refactoring of packages and class names
- Fluent interface for adding of components to a container
April, 2007:
Work begins on PicoContainer 2.x. It is substantially a refactoring of the PicoContainer 1.x codeline using the inbuilt
features of Intellij IDEA and Eclipse. Using the existing unit tests as a guide, many small commits were made to
the code-base to take PicoContainer in a more JDK 1.5 direction, and add in other features not seen in competing
containers like parameter name access. Along the way, the API was simplified and parts of NanoContainer were bought
closer to the core of PicoContainer.
Mar 18, 2007
PicoContainer 1.3 released (113K jar)
January 19, 2006
PicoContainer 1.2 released (112K jar)
November 4, 2004
PicoContainer 1.1 released (75K jar)
June 5, 2004
PicoContainer 1.0 released (49K jar)
February 21, 2004
PicoContainer 1.0 beta-5 (50K jar)
PicoContainer split into a core jar and 'gems' for things less often used
January 23, 2004
PicoContainer 1.0 beta-4 (64K jar)
November 03, 2003
PicoContainer 1.0 beta-3 (52K jar)
September 10, 2003
PicoContainer 1.0 beta-2 (44K jar)
August 14, 2003
PicoContainer 1.0 beta-1 (39K jar)
July 17, 2003
PicoContainer 1.0 alpha-2 (36K jar)
Setter Injection added (this was after the Pico team learned of the Spring-Framework project, Spring did not add
Constructor Injection until the run up to 1.0-Milestone-3 in November '03 and 'autowiring' in the run up to
1-0-Milestone-4 in January of '04)
June 29, 2003
PicoContainer 1.0 alpha-1 (25K jar)
Generalized Constructor Injection available for the first time. This was very much PicoContainer's idiom. ATG Dynamo
had something similar for web components, but Pico released this first as a general embedable API for the Java
world. Goals for Pico are a) lightweight/embeddable, b) no XML or meta-data - 'autowiring' only, c) no lock-in, d)
popularize Constructor Injection over Avalon and OSGi style of IoC, e) no dependencies for the container itself.
June 1, 2003
PicoContainer experimentation begins
Paul and Aslak pair on a precursor to PicoContainer called 'xContainer'. See the source


LTech
Home
(current)
Sign in
As a student
As a teacher
Sign up
As a student
As a teacher
Are you Ready to learn?
Predictive Analysis
Lorem ipsum
Previous
Next


Clients
Application Name
App Short Name
Application Options
Name
Short Name
Description
Add this application
Add An application
Cancel Add


b Class
Item Index
Methods
- abs
- acos
- addPage
- addPath
- addToStory
- applyMatrix
- asin
- atan
- atan2
- beginShape
- binary
- bleeds
- blendMode
- bounds
- canvasMode
- ceil
- characters
- characterStyle
- clear
- close
- color
- colorMode
- constrain
- cos
- CSV.decode
- CSV.delimiter
- CSV.encode
- day
- degrees
- delay
- dist
- doc
- download
- duplicate
- ellipse
- ellipseMode
- endShape
- endsWith
- exp
- fill
- fillTint
- floor
- forEach
- go
- Group
- Group
- guideX
- guideY
- HashList
- HashList.clear
- HashList.get
- HashList.getKeys
- HashList.getKeys
- HashList.getKeysByValues
- HashList.getSortedKeys
- HashList.hasKey
- HashList.hasValue
- HashList.remove
- HashList.set
- hex
- hour
- image
- imageMode
- inspect
- isArray
- isNumber
- isString
- isText
- isURL
- itemHeight
- itemPosition
- items
- itemSize
- itemWidth
- itemX
- itemY
- join
- JSON.decode
- JSON.encode
- label
- labels
- layer
- lerp
- lerpColor
- line
- lines
- linkTextFrames
- loadString
- loadStrings
- log
- loop
- mag
- map
- margins
- matrix
- max
- millis
- min
- minute
- month
- nameOnPage
- nf
- nfc
- nfp
- nfs
- noFill
- noise
- noiseDetail
- noiseSeed
- noLoop
- norm
- noStroke
- objectStyle
- opacity
- page
- pageCount
- pageNumber
- paragraphs
- paragraphStyle
- popMatrix
- pow
- printInfo
- println
- printMatrix
- projectPath
- pushMatrix
- radians
- random
- rect
- rectMode
- remove
- removePage
- resetMatrix
- rotate
- round
- savePDF
- savePNG
- saveString
- saveStrings
- scale
- second
- selection
- selections
- shellExecute
- sin
- split
- splitTokens
- sq
- sqrt
- startsWith
- stories
- storyCount
- stroke
- strokeTint
- strokeWeight
- tan
- text
- textAlign
- textFont
- textKerning
- textLeading
- textSize
- textTracking
- transform
- transformImage
- translate
- trim
- trimWord
- typo
- unbinary
- unhex
- units
- Vector
- Vector.add
- Vector.angleBetween static
- Vector.array
- Vector.cross static
- Vector.cross
- Vector.dist static
- Vector.dist
- Vector.div
- Vector.dot
- Vector.dot static
- Vector.get
- Vector.heading
- Vector.limit
- Vector.mag
- Vector.mult
- Vector.normalize
- Vector.set
- Vector.sub
- Vector.toString
- vertex
- words
- year
Methods
abs
-
val
Calculates the absolute value (magnitude) of a number. The absolute value of a number is always positive.
Parameters:
-
val
NumberAn arbitrary number
Returns:
acos
-
value
The inverse of cos(), returns the arc cosine of a value. This function expects the values in the range of -1 to 1 and values are returned in the range 0 to PI (3.1415927).
Parameters:
-
value
Numberthe value whose arc cosine is to be returned
Returns:
addPage
-
[location]
Adds a new page to the document. Set the optional location parameter to either b.ATEND (default), b.ATBEGINNING, b.AFTER or b.BEFORE. b.AFTER and b.BEFORE will use the current page as insertion point.
Parameters:
-
[location]
String optionalThe location placement mode
Returns:
addPath
()
addPath() is used to create multi component paths. Call addPath() to add the so far drawn vertices to a single path. New vertices will then end up in a new path. endShape() will then return a multi path object. All component paths will account for the setting (see b.CLOSE) given in beginShape(shapeMode).
addToStory
-
story
-
itemOrString
-
insertionPointOrMode
Adds a page item or a string to an existing story. You can control the position of the insert via the last parameter. It accepts either an InsertionPoint or one the following constants: b.ATBEGINNING and b.ATEND.
applyMatrix
-
matrix
Multiplies the current matrix by the one specified through the parameters.
Parameters:
-
matrix
Matrix2DThe matrix to be applied
asin
-
value
The inverse of sin(), returns the arc sine of a value. This function expects the values in the range of -1 to 1 and values are returned in the range 0 to PI (3.1415927).
Parameters:
-
value
Numberthe value whose arc sine is to be returned
Returns:
atan
-
value
The inverse of tan(), returns the arc tangent of a value. This function expects the values in the range of -1 to 1 and values are returned in the range 0 to PI (3.1415927).
Parameters:
-
value
Numberthe value whose arc tangent is to be returned
Returns:
atan2
-
y
-
x
Calculates the angle (in radians) from a specified point to the coordinate origin as measured from the positive x-axis. Values are returned as a float in the range from PI to -PI. The atan2() function is most often used for orienting geometry to the position of the cursor. Note: The y-coordinate of the point is the first parameter and the x-coordinate is the second due the the structure of calculating the tangent.
Returns:
beginShape
-
shapeMode
Using the beginShape() and endShape() functions allow creating more complex forms. beginShape() begins recording vertices for a shape and endShape() stops recording. After calling the beginShape() function, a series of vertex() commands must follow. To stop drawing the shape, call endShape(). The value of the parameter tells whether the paths to create from the provided vertices have to be closed or not (to connect the beginning and the end).
Parameters:
-
shapeMode
ObjectSet b.CLOSE if the new Path should be auto-closed.
binary
-
num
-
[numBits]
Converts a byte, char, int, or color to a String containing the equivalent binary notation. For example color(0, 102, 153, 255) will convert to the String "11111111000000000110011010011001". This function can help make your geeky debugging sessions much happier.
Returns:
bleeds
-
[top]
-
[right]
-
[bottom]
-
[left]
Sets the document bleeds. If one value is given, all 4 are set equally. If 4 values are given, the top/right/bottom/left document bleeds will be adjusted. Calling the function without any values, will return the document bleed settings.
blendMode
-
obj
-
blendMode
Sets the Effects blendMode property of an object.
Parameters:
-
obj
ObjectThe object to set blendMode property
-
blendMode
NumberThe blendMode must be one of the InDesign BlendMode enum values: BlendMode.NORMAL
BlendMode.MULTIPLY
BlendMode.SCREEN
BlendMode.OVERLAY
BlendMode.SOFTLIGHT
BlendMode.HARDLIGHT
BlendMode.COLORDODGE
BlendMode.COLORBURN
BlendMode.DARKEN
BlendMode.LIGHTEN
BlendMode.DIFFERENCE
BlendMode.EXCLUSION
BlendMode.HUE
BlendMode.SATURATION
BlendMode.COLOR
BlendMode.LUMINOSITY
bounds
-
obj
The function calculates the geometric bounds of any given object. Use b.itemX(), b.itemY(), b.itemPosition(), b.itemWidth(), b.itemHeight() and b.itemSize() to modify PageItems. In case the object is any kind of text, then additional typographic information baseline and xHeight are calculated
Parameters:
-
obj
Text | ObjectThe object to calculate the geometric bounds
Returns:
canvasMode
()
Use this to set the dimensions of the canvas. Choose between b.PAGE (default), b.MARGIN, b.BLEED resp. b.FACINGPAGES, b.FACINGMARGINS and b.FACING_BLEEDS for book setups with facing page. Please note: Setups with more than two facing pages are not yet supported. Please note that you will loose your current MatrixTransformation. You should set the canvasMode before you attempt to use b.translate(), b.rotate() and b.scale();
ceil
-
val
Calculates the closest int value that is greater than or equal to the value of the parameter. For example, ceil(9.03) returns the value 10.
Parameters:
-
val
NumberAn arbitrary number
Returns:
characters
-
item
-
[cb]
If no callback function is given it returns a Collection of items otherwise calls the given callback function with each character of the given document, story, text frame, paragraph, line or word.
Parameters:
-
item
Document | Story | TextFrame | Paragraph | Line | WordThe document, story, text frame, paragraph, line or word instance to iterate the characters in
-
[cb]
Function optionalOptional: The callback function to call with each character. When this function returns false the loop stops. Passed arguments: character, loopCount
Returns:
characterStyle
-
name
Returns the character style with the given name. If the style does not exist it gets created.
Parameters:
-
name
StringThe name of the character style to return.
Returns:
clear
-
container
Removes all PageItems in the given Document, Page, Layer or Group.
Parameters:
-
container
Document | Page | Layer | GroupThe container where the PageItems sit in
close
-
[saveOptions]
-
[file]
Closes the current document.
Parameters:
-
[saveOptions]
SaveOptions | Boolean optionalThe indesign SaveOptions constant or either true for triggering saving before closing or false for closing without saving.
-
[file]
File optionalOptional: The indesign file instance to save the document to
color
-
Get
Creates a new RGB or CMYK color and adds the new color to the document, or gets a color by name from the document. The default color mode is RBG.
Parameters:
-
Get
String | Numberscolor: the color name. Create new color: R,G,B,name or C,M,Y,K,name or Grey,name. Name is always optional
Returns:
colorMode
-
colorMode
Sets the colormode for creating new colors with b.color() to RGB or CMYK. The default color mode is RBG.
Parameters:
-
colorMode
NumberEither b.RGB or b.CMYK
constrain
-
aNumber
-
aMin
-
aMax
Constrains a value to not exceed a maximum and minimum value.
Parameters:
Returns:
cos
-
rad
Calculates the cosine of an angle. This function expects the values of the angle parameter to be provided in radians (values from 0 to PI*2). Values are returned in the range -1 to 1.
Parameters:
-
rad
Numbera value in radians
Returns:
CSV.decode
-
String
Function parses a string as CSV-object Array. Usage: var arr = b.CSV.decode(str); var str = b.CSV.encode(arr);
Parameters:
-
String
Stringto be parsed as CSV-object.
Returns:
CSV.delimiter
-
[delimiter]
Sets the delimiter of the CSV decode and encode function.
Parameters:
-
[delimiter]
String optionalOptional Sets the delimiter for CSV parsing
Returns:
CSV.encode
-
Array
Function convert an javascript array of objects to a CSV-string. Usage: var str = b.CSV.encode(arr); var arr = b.CSV.decode(str);
Parameters:
-
Array
Arrayto be converted to a CSV-string
Returns:
degrees
-
aAngle
Converts a radian measurement to its corresponding value in degrees. Radians and degrees are two ways of measuring the same thing. There are 360 degrees in a circle and 2*PI radians in a circle. For example, 90° = PI/2 = 1.5707964. All trigonometric methods in Processing require their parameters to be specified in radians.
Parameters:
-
aAngle
Numberan angle in radians
Returns:
delay
-
milliseconds
Suspends the calling thread for a number of milliseconds. During a sleep period, checks at 100 millisecond intervals to see whether the sleep should be terminated.
Parameters:
-
milliseconds
NumberThe delay time in milliseconds
dist
-
x1
-
y1
-
x2
-
y2
Calculates the distance between two points.
Parameters:
Returns:
doc
-
[doc]
Sets or possibly creates the current document and returns it. If the param doc is not given the current document gets set to the active document in the application. If no document at all is open, a new document gets created.
Parameters:
-
[doc]
Document optionalThe document to set the current document to
Returns:
download
-
url
-
[file]
Downloads an URL to a file, currently Mac only.
duplicate
-
item
Duplicates the given page after the current page or the given pageitem to the current page and layer. Use b.rectMode() to set center point.
Parameters:
-
item
PageItem | PageThe item to duplicate
Returns:
ellipse
-
x
-
y
-
w
-
h
Draws an ellipse (oval) in the display window. An ellipse with an equal width and height is a circle. The first two parameters set the location, the third sets the width, and the fourth sets the height.
Returns:
ellipseMode
-
mode
The origin of the ellipse is modified by the ellipseMode() function. The default configuration is ellipseMode(CENTER), which specifies the location of the ellipse as the center of the shape. The RADIUS mode is the same, but the width and height parameters to ellipse() specify the radius of the ellipse, rather than the diameter. The CORNER mode draws the shape from the upper-left corner of its bounding box. The CORNERS mode uses the four parameters to ellipse() to set two opposing corners of the ellipse's bounding box. The parameter must be written in "ALL CAPS".
Parameters:
-
mode
StringEither b.CENTER, b.RADIUS, b.CORNER, or b.CORNERS
endShape
()
GraphicLine | Polygon
The endShape() function is the companion to beginShape() and may only be called after beginShape().
Returns:
endsWith
-
str
Checks whether a string ends with a specific character or string.
Parameters:
-
str
StringA string to be checked
Returns:
exp
-
a
Returns Euler's number e (2.71828...) raised to the power of the value parameter.
Parameters:
-
a
Numbervalue
Returns:
fill
-
fillColor
Sets the color used to fill shapes.
Parameters:
-
fillColor
Color | Swatch | NumbersAccepts a Color/swatch or a string with the name of a color. Or values: C,M,Y,K / R,G,B / Grey
fillTint
-
tint
Sets the tint of the color used to fill shapes.
Parameters:
-
tint
NumberNumber from 0 to 100
floor
-
a
Calculates the closest int value that is less than or equal to the value of the parameter.
Parameters:
-
a
Numbervalue
Returns:
forEach
-
collection
-
cb
Used to run a function on all elements of an array. Please note the existance of the convenience methods b.stories(), b.paragraphs(), b.lines(), b.words() and b.characters() that are used to iterate through all instances of the given type in the given document.
go
-
[modes]
Run the sketch! Has to be called in every sketch a the very end of the code.
You may add performance setting options when calling b.go():
b.go(b.MODEVISIBLE) or alternatively: b.go()
b.go(b.MODESILENT)
b.go(b.MODEHIDDEN)
Currently there is no performance optimization in b.loop()
Parameters:
-
[modes]
MODESILENT | MODEHIDDEN | MODEVISIBLE optionalOptional: Switch performanceMode
Group
-
[pItem]
-
name
Returns the Group instance and sets it if argument Group is given.
Parameters:
Returns:
Group
-
[pItem]
-
name
Returns an array of the items that were within the Group before b.ungroup() was called
Parameters:
Returns:
guideX
-
x
Creates a vertical guide line at the current spread and current layer.
Parameters:
-
x
NumberPosition of the new guide
Returns:
guideY
-
y
Creates a horizontal guide line at the current spread and current layer.
Parameters:
-
y
NumberPosition of the new guide
Returns:
HashList
()
HashList is a data container that allows you to store information as key -> value pairs. As usual in JavaScript mixed types of keys and values are accepted in one HashList instance.
HashList.clear
()
Deletes all the key -> value pairs in this HashList.
HashList.get
-
key
This gets a value by its key.
Parameters:
-
key
AnyThe key to look for
Returns:
HashList.getKeys
()
Array
Returns an array with all keys.
Returns:
HashList.getKeys
()
Array
Returns an array with all keys.
Returns:
HashList.getKeysByValues
()
Array
Returns an array of all keys that are sorted by their values from highest to lowest. Please note that this only works if you have conistently used Numbers for values.
Returns:
HashList.getSortedKeys
()
Array
Returns an array with all keys in a sorted order from higher to lower magnitude.
Returns:
HashList.hasKey
-
key
Checks for the existence of a given key.
Parameters:
-
key
AnyThe key to check
Returns:
HashList.hasValue
-
value
Checks if a certain value exists at least once in all of the key -> value pairs.
Parameters:
-
value
Any
Returns:
HashList.remove
-
key
This removes a key -> value pair by its key.
Parameters:
-
key
AnyThe key to delete
Returns:
HashList.set
-
key
-
value
This sets a key -> value pair. If a key is already existing, the value will be updated. Please note that Functions are currently not supported as values.
Parameters:
-
key
AnyThe key to use
-
value
AnyThe value to set
Returns:
hex
-
value
-
[len]
Convert a number to a hex representation.
Parameters:
Returns:
image
-
img
-
x
-
[y]
-
[w]
-
[h]
Adds an image to the document. If the image argument is given as a string the image file must be in the document's data directory which is in the same directory where the document is saved in. The image argument can also be a File instance which can be placed even before the document was saved. The second argument can either be the x position of the frame to create or an instance of a rectangle, oval or polygon to place the image in. If x and y positions are given and width and height are not given, the frame's size gets set to the original image size.
Parameters:
-
img
String | FileThe image file name in the document's data directory or a File instance
-
x
Number | Rectangle | Oval | PolygonThe x position on the current page or the item instance to place the image in
-
[y]
Number optionalThe y position on the current page. Ignored if x is not a number.
-
[w]
Number optionalThe width of the rectangle to add the image to. Ignored if x is not a number.
-
[h]
Number optionalThe height of the rectangle to add the image to. Ignored if x is not a number.
Returns:
imageMode
-
[mode]
Modifies the location from which images draw. The default mode is imageMode(CORNER), which specifies the location to be the upper left corner and uses the fourth and fifth parameters of image() to set the image's width and height. The syntax imageMode(CORNERS) uses the second and third parameters of image() to set the location of one corner of the image and uses the fourth and fifth parameters to set the opposite corner. Use imageMode(CENTER) to draw images centered at the given x and y position. If no parameter is passed the currently set mode is returned as String.
Parameters:
-
[mode]
String optionalEither b.CORNER, b.CORNERS, or b.CENTER
Returns:
inspect
-
obj
-
maxlevel
Prints out all properties and values off an object in a recursive manner to the console. Useful for inspecting (or debugging) nested variable. the default value for the recursion is maxlevel = 2.
isArray
-
obj
Checks whether a var is an Array, returns true if this is the case
Returns:
isNumber
-
num
Checks whether a var is a number, returns true if this is the case
Returns:
isString
-
str
Checks whether a var is a string, returns true if this is the case
Returns:
isText
-
obj
Checks whether a var is an indesign text object, returns true if this is the case NB: a indesign TextFrame will return false as it is just a container holding text. So you could say that isText() refers to all the things inside a TextFrame.
Parameters:
-
obj
Character | InsertionPoint | Line | Paragraph | TextColumn | TextStyleRange | WordThe object to check
Returns:
isURL
-
url
Checks whether an URL string is valid.
Parameters:
-
url
StringAn url string to be checked
Returns:
itemHeight
-
pItem
-
[height]
Scales the given PageItem to the given height. If height is not given as argument the current height is returned.
Parameters:
-
pItem
PageItemThe PageItem to alter
-
[height]
Number optionalThe new height
Returns:
itemPosition
-
pItem
-
[x]
-
[y]
Moves the given PageItem to the given position. If x or y is not given as argument the current position is returned.
Parameters:
Returns:
items
-
container
-
[cb]
If no callback function is given it returns a Collection of items otherwise calls the given callback function for each of the PageItems in the given Document, Page, Layer or Group.
Parameters:
Returns:
itemSize
-
pItem
-
[width]
-
[height]
Scales the given PageItem to the given size. If width or height is not given as argument the current size is returned.
Parameters:
Returns:
itemWidth
-
pItem
-
[width]
Scales the given PageItem to the given width. If width is not given as argument the current width is returned.
Parameters:
-
pItem
PageItemThe PageItem to alter
-
[width]
Number optionalThe new width
Returns:
itemX
-
pItem
-
[x]
Positions a PageItem at the designated spot on the x axis. If no x argument is given the current x position is returned.
Parameters:
-
pItem
PageItemThe PageItem to alter
-
[x]
Number optionalThe new x position
Returns:
itemY
-
pItem
-
[y]
Positions a PageItem at the designated spot on the y axis. If no y argument is given the current y position is returned.
Parameters:
-
pItem
PageItemThe PageItem to alter
-
[y]
Number optionalThe new y position
Returns:
join
-
array
-
separator
Combines an array of Strings into one String, each separated by the character(s) used for the separator parameter. To join arrays of ints or floats, it's necessary to first convert them to strings using nf() or nfs().
Returns:
JSON.decode
-
String
Function parses and validates a string as JSON-object. Usage: var obj = b.JSON.decode(str); var str = b.JSON.encode(obj);
Parameters:
-
String
Stringto be parsed as JSON-object.
Returns:
JSON.encode
-
Object
Function convert an javascript object to a JSON-string. Usage: var str = b.JSON.encode(obj); var obj = b.JSON.decode(str);
Parameters:
-
Object
Objectto be converted to a JSON-string
Returns:
label
-
label
Returns the first item that is tagged with the given label in the InDesign Script Label pane (Window -> Utilities -> Script Label). Use this instead of b.labels, when you know you just have one thing with that label and don't want to deal with a single-element array.
Parameters:
-
label
StringThe label identifier
Returns:
labels
-
label
-
[cb]
Returns items tagged with the given label in the InDesign Script Label pane (Window -> Utilities -> Script Label).
Parameters:
Returns:
layer
-
[layer]
Returns the current layer and sets it if argument layer is given.
Parameters:
-
[layer]
Layer | String optionalThe layer or layer name to set the current layer to
Returns:
lerp
-
value1
-
value2
-
amt
Calculates a number between two numbers at a specific increment. The amt parameter is the amount to interpolate between the two values where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 is half-way in between, etc. The lerp function is convenient for creating motion along a straight path and for drawing dotted lines.
Returns:
lerpColor
-
c1
-
c2
-
amt
Calculates a color or colors between two color at a specific increment. The amt parameter is the amount to interpolate between the two values where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 is half-way in between, etc. N.B.: Both color must be either CMYK or RGB.
Parameters:
-
c1
ColorInput color 1
-
c2
ColorInput color 2
-
amt
NumberThe Amount to interpolate between the two colors
Returns:
line
-
x1
-
y1
-
x2
-
y2
Draws a line (a direct path between two points) to the page.
Parameters:
Returns:
lines
-
item
-
[cb]
If no callback function is given it returns a Collection of items otherwise calls the given callback function with each line of the given document, story, text frame or paragraph.
Parameters:
-
item
Document | Story | TextFrame | ParagraphThe document, story, text frame or paragraph instance to iterate the lines in
-
[cb]
Function optionalOptional: The callback function to call with each line. When this function returns false the loop stops. Passed arguments: line, loopCount
Returns:
linkTextFrames
-
textFrameA
-
textFrameB
Links the stories of two textframes to one story. Text of first textframe overflows to second one.
Parameters:
-
textFrameA
TextFrame -
textFrameB
TextFrame
loadString
-
fileOrString
Reads the contents of a file or loads an URL into a String. If the file is specified by name as String, it must be located in the document's data directory.
Parameters:
-
fileOrString
String | FileThe text file name in the document's data directory or a File instance or an URL
Returns:
loadStrings
-
file
Reads the contents of a file or loads an URL and creates a String array of its individual lines. If the file is specified by name as String, it must be located in the document's data directory.
Parameters:
-
file
String | FileThe text file name in the document's data directory or a File instance or an URL
Returns:
log
-
number
Calculates the natural logarithm (the base-e logarithm) of a number. This function expects the values greater than 0.0.
Parameters:
-
number
Numbermust be greater then 0.0
Returns:
loop
-
framerate
EXPERIMENTAL!
Causes basil to continuously execute the code within draw() when InDesign is idle.
targetengine "loop"; must be at the very top in the script file.
If noLoop() is called, the code in draw() stops executing. It is essential to call noLoop() or execute the script lib/stop.jsx when the script is finished! The framerate property determines how often draw() is called per second, e.g. a framerate of 20 will 20times call draw() per second.
Parameters:
-
framerate
NumberThe framerate per second, determines how often draw() is called per second.
mag
-
a
-
b
-
[c]
Calculates the magnitude (or length) of a vector. A vector is a direction in space commonly used in computer graphics and linear algebra. Because it has no "start" position, the magnitude of a vector can be thought of as the distance from coordinate (0,0) to its (x,y) value. Therefore, mag() is a shortcut for writing "dist(0, 0, x, y)".
Returns:
map
-
value
-
istart
-
istop
-
ostart
-
ostop
Re-maps a number from one range to another. In the example above, the number '25' is converted from a value in the range 0..100 into a value that ranges from the left edge (0) to the right edge (width) of the screen.
Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful.
Parameters:
Returns:
margins
-
[top]
-
[right]
-
[bottom]
-
[left]
-
[pageNumber]
Sets the margins of a given page. If 1 value is given, all 4 sides are set equally. If 4 values are given, the current page will be adjusted. Adding a 5th value will set the margin of a given page. Calling the function without any values, will return the margins for the current page.
Parameters:
Returns:
matrix
-
[matrix]
Returns the current matrix as a Matrix2D object for altering existing PageItems with b.transform(). If a Matrix2D object is provided to the function it will overwrite the current matrix.
Parameters:
-
[matrix]
Matrix2D optionalThe matrix to be set as new current matrix
Returns:
max
-
param1
-
param2
-
param3
Determines the largest value in a sequence of numbers.
Parameters:
Returns:
millis
()
Number
Returns the number of milliseconds (thousandths of a second) since starting an applet. This information is often used for timing animation sequences.
Returns:
min
-
param1
-
param2
-
param3
Determines the smallest value in a sequence of numbers.
Parameters:
Returns:
nameOnPage
()
Object
Returns the first item on the active page that is named by the given name in the Layers pane (Window -> Layer).
Returns:
nf
-
value
-
leftDigits
-
rightDigits
Utility function for formatting numbers into strings. There are two versions, one for formatting floats and one for formatting ints. The values for the digits, left, and right parameters should always be positive integers.
As shown in the above example, nf() is used to add zeros to the left and/or right of a number. This is typically for aligning a list of numbers. To remove digits from a floating-point number, use the int(), ceil(), floor(), or round() functions.
Returns:
nfc
-
value
-
leftDigits
-
rightDigits
Utility function for formatting numbers into strings and placing appropriate commas to mark units of 1000. There are two versions, one for formatting ints and one for formatting an array of ints. The value for the digits parameter should always be a positive integer.
Returns:
nfp
-
value
-
leftDigits
-
rightDigits
Utility function for formatting numbers into strings.  There are two versions, one for formatting floats and one for formatting ints. The values for the digits, left, and right parameters should always be positive integers.
Returns:
nfs
-
value
-
leftDigits
-
rightDigits
Utility function for formatting numbers into strings. Similar to nf() but leaves a blank space in front of positive numbers so they align with negative numbers in spite of the minus symbol. There are two versions, one for formatting floats and one for formatting ints. The values for the digits, left, and right parameters should always be positive integers.
Returns:
noFill
()
Disables filling geometry. If both noStroke() and noFill() are called, newly drawn shapes will be invisible.
noise
-
x
-
[y]
-
[z]
Returns the Perlin noise value at specified coordinates. Perlin noise is a random sequence generator producing a more natural ordered, harmonic succession of numbers compared to the standard random() function. It was invented by Ken Perlin in the 1980s and been used since in graphical applications to produce procedural textures, natural motion, shapes, terrains etc.
The main difference to the random() function is that Perlin noise is defined in an infinite n-dimensional space where each pair of coordinates corresponds to a fixed semi-random value (fixed only for the lifespan of the program). The resulting value will always be between 0.0 and 1.0. basil.js can compute 1D, 2D and 3D noise, depending on the number of coordinates given. The noise value can be animated by moving through the noise space. The 2nd and 3rd dimension can also be interpreted as time.
The actual noise is structured similar to an audio signal, in respect to the function's use of frequencies. Similar to the concept of harmonics in physics, perlin noise is computed over several octaves which are added together for the final result.
Another way to adjust the character of the resulting sequence is the scale of the input coordinates. As the function works within an infinite space the value of the coordinates doesn't matter as such, only the distance between successive coordinates does (eg. when using noise() within a loop). As a general rule the smaller the difference between coordinates, the smoother the resulting noise sequence will be. Steps of 0.005-0.03 work best for most applications, but this will differ depending on use.
Parameters:
Returns:
noiseDetail
-
octaves
-
fallout
Adjusts the character and level of detail produced by the Perlin noise function. Similar to harmonics in physics, noise is computed over several octaves. Lower octaves contribute more to the output signal and as such define the overal intensity of the noise, whereas higher octaves create finer grained details in the noise sequence. By default, noise is computed over 4 octaves with each octave contributing exactly half than its predecessor, starting at 50% strength for the 1st octave. This falloff amount can be changed by adding an additional function parameter. Eg. a falloff factor of 0.75 means each octave will now have 75% impact (25% less) of the previous lower octave. Any value between 0.0 and 1.0 is valid, however note that values greater than 0.5 might result in greater than 1.0 values returned by noise().
By changing these parameters, the signal created by the noise() function can be adapted to fit very specific needs and characteristics.
noiseSeed
-
seed
Sets the seed value for noise(). By default, noise() produces different results each time the program is run. Set the value parameter to a constant to return the same pseudo-random numbers each time the software is run.
Parameters:
-
seed
Number
noLoop
()
EXPERIMENTAL!
Stops basil from continuously executing the code within draw().
norm
-
aNumber
-
low
-
low
Normalizes a number from another range into a value between 0 and 1.
Identical to map(value, low, high, 0, 1);
Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful.
Parameters:
Returns:
noStroke
()
Disables drawing the stroke (outline). If both noStroke() and noFill() are called, nothing will be drawn to the screen.
objectStyle
-
name
Returns the object style with the given name. If the style does not exist it gets created.
Parameters:
-
name
StringThe name of the object style to return.
Returns:
opacity
-
obj
-
opacity
Sets the opacity property of an object.
page
-
[page]
Returns the current page and sets it if argument page is given. Numbering starts with 1.
Parameters:
-
[page]
Page | Number | PageItem optionalThe page object or page number to set the current page to. If you pass a PageItem the current page will be set to it's containing page.
Returns:
pageCount
()
The number of all pages in the current document.
Returns:
pageNumber
-
[pageObj]
Returns the current page number of either the current page or the given Page object.
Parameters:
-
[pageObj]
Page optionalOptional: The page you want to know the number of.
Returns:
paragraphs
-
item
-
[cb]
If no callback function is given it returns a Collection of items otherwise calls the given callback function with each paragraph of the given document, story or text frame.
Parameters:
-
item
Document | Story | TextFrameThe story or text frame instance to iterate the paragraphs in
-
[cb]
Function optionalOptional: The callback function to call with each paragraph. When this function returns false the loop stops. Passed arguments: para, loopCount
Returns:
paragraphStyle
-
name
Returns the paragraph style with the given name. If the style does not exist it gets created.
Parameters:
-
name
StringThe name of the paragraph style to return.
Returns:
popMatrix
()
Pops the current transformation matrix off the matrix stack. Understanding pushing and popping requires understanding the concept of a matrix stack. The pushMatrix() function saves the current coordinate system to the stack and popMatrix() restores the prior coordinate system. pushMatrix() and popMatrix() are used in conjuction with the other transformation methods and may be embedded to control the scope of the transformations.
pow
-
num
-
exponent
Facilitates exponential expressions. The pow() function is an efficient way of multiplying numbers by themselves (or their reciprocal) in large quantities. For example, pow(3, 5) is equivalent to the expression 33333 and pow(3, -5) is equivalent to 1 / 33333
Parameters:
Returns:
print
-
msg
Prints a message to the console output in the ExtendScript editor, but unlike b.println() it doesn't return the carriage to a new line at the end.
Parameters:
-
msg
StringThe message to print
printInfo
()
Print numerous information about the current environment to the console
println
-
msg
Prints a message line to the console output in the ExtendScript editor.
Parameters:
-
msg
StringThe message to print
printMatrix
()
Prints the current matrix to the console window.
projectPath
()
File
Get the full path to the folder of the active document.
Returns:
pushMatrix
()
Pushes the current transformation matrix onto the matrix stack. Understanding pushMatrix() and popMatrix() requires understanding the concept of a matrix stack. The pushMatrix() function saves the current coordinate system to the stack and popMatrix() restores the prior coordinate system. pushMatrix() and popMatrix() are used in conjuction with the other transformation methods and may be embedded to control the scope of the transformations.
radians
-
aAngle
Converts a degree measurement to its corresponding value in radians. Radians and degrees are two ways of measuring the same thing. There are 360 degrees in a circle and 2*PI radians in a circle. For example, 90° = PI/2 = 1.5707964. All trigonometric methods in Processing require their parameters to be specified in radians.
Parameters:
-
aAngle
Numberan angle in degree
Returns:
random
-
[low]
-
[high]
Generates random numbers. Each time the random() function is called, it returns an unexpected value within the specified range. If one parameter is passed to the function it will return a float between zero and the value of the high parameter. The function call random(5) returns values between 0 and 5. If two parameters are passed, it will return a float with a value between the the parameters. The function call random(-5, 10.2) returns values between -5 and 10.2.
One parameter sets the range from 0 to the given parameter, while with two parameters present you set the range from val1 - val2.
Parameters:
Returns:
rect
-
x
-
y
-
w
-
h
Draws a rectangle on the page.
Returns:
rectMode
-
mode
Modifies the location from which rectangles draw. The default mode is rectMode(CORNER), which specifies the location to be the upper left corner of the shape and uses the third and fourth parameters of rect() to specify the width and height. The syntax rectMode(CORNERS) uses the first and second parameters of rect() to set the location of one corner and uses the third and fourth parameters to set the opposite corner. The syntax rectMode(CENTER) draws the image from its center point and uses the third and forth parameters of rect() to specify the image's width and height. The syntax rectMode(RADIUS) draws the image from its center point and uses the third and forth parameters of rect() to specify half of the image's width and height. The parameter must be written in "ALL CAPS".
Parameters:
-
mode
StringEither b.CORNER, b.CORNERS, b.CENTER, or b.RADIUS
remove
-
obj
Removes the provided Page, Layer, PageItem, Swatch, etc.
Parameters:
-
obj
PageItemThe object to be removed
removePage
-
[page]
Removes a page from the current document. This will either be the current Page if the parameter page is left empty, or the given Page object or page number.
Parameters:
-
[page]
Page | Number optionalOptional: The page to be removed as Page object or page number.
resetMatrix
()
Replaces the current matrix with the identity matrix.
rotate
-
angle
Rotates an object the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction with 0 radians or degrees being up and HALF_PI being to the right etc. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotate(PI/2) and then rotate(PI/2) is the same as rotate(PI). If rotate() is called within the draw(), the transformation is reset when the loop begins again. Technically, rotate() multiplies the current transformation matrix by a rotation matrix. This function can be further controlled by the pushMatrix() and popMatrix().
Parameters:
-
angle
NumberThe angle specified in radians
round
-
value
Calculates the integer closest to the value parameter. For example, round(9.2) returns the value 9.
Parameters:
-
value
NumberThe value to be rounded
Returns:
savePDF
-
file
-
[showOptions]
Exports the current document as PDF to the documents folder. Please note, that export options default to the last used export settings.
savePNG
-
file
-
[showOptions]
Exports the current document as PNG (or sequence of PNG files) to the documents folder. Please note, that export options default to the last used export settings.
saveString
-
file
-
string
Writes a string to a file. If the given file exists it gets overridden.
saveStrings
-
file
-
strings
Writes an array of strings to a file, one line per string. If the given file exists it gets overridden.
scale
-
scaleX
-
scaleY
Increasing and decreasing the size of an object by expanding and contracting vertices. Scale values are specified as decimal percentages. The function call scale(2.0) increases the dimension of a shape by 200%. Objects always scale from their relative origin to the coordinate system. Transformations apply to everything that happens after and subsequent calls to the function multiply the effect. For example, calling scale(2.0) and then scale(1.5) is the same as scale(3.0). If scale() is called within draw(), the transformation is reset when the loop begins again. This function can be further controlled by pushMatrix() and popMatrix(). If only one parameter is given, it is applied on X and Y axis.
selection
()
Object
Returns the first currently selected object. Use this if you know you only have one selected item and don't want to deal with an array.
Returns:
selections
-
[cb]
Returns the currently selected object(s)
Parameters:
-
[cb]
Function optionalOptional: The callback function to call with each item in the selection. When this function returns false the loop stops. Passed arguments: item, loopCount
Returns:
shellExecute
-
cmd
Executes a shell command and returns the result, currently Mac only.
BE CAREFUL!
Parameters:
-
cmd
StringThe shell command to execute
Returns:
sin
-
rad
Calculates the sine of an angle. This function expects the values of the angle parameter to be provided in radians (values from 0 to 6.28). Values are returned in the range -1 to 1.
Parameters:
-
rad
Numbera value in radians
Returns:
split
-
str
-
[delim]
The split() function breaks a string into pieces using a character or string as the divider. The delim parameter specifies the character or characters that mark the boundaries between each piece. A String[] array is returned that contains each of the pieces.
If the result is a set of numbers, you can convert the String[] array to to a float[] or int[] array using the datatype conversion functions int() and float() (see example above).
The splitTokens() function works in a similar fashion, except that it splits using a range of characters instead of a specific character or sequence.
Parameters:
Returns:
splitTokens
-
str
-
[tokens]
The splitTokens() function splits a String at one or many character "tokens." The tokens parameter specifies the character or characters to be used as a boundary.
If no tokens character is specified, any whitespace character is used to split. Whitespace characters include tab (\t), line feed (\n), carriage return (\r), form feed (\f), and space. To convert a String to an array of integers or floats, use the datatype conversion functions int() and float() to convert the array of Strings.
Parameters:
Returns:
sq
-
aNumber
Squares a number (multiplies a number by itself). The result is always a positive number, as multiplying two negative numbers always yields a positive result. For example, -1 * -1 = 1.
Parameters:
-
aNumber
NumberThe value to be squared
Returns:
sqrt
-
val
Calculates the square root of a number. The square root of a number is always positive, even though there may be a valid negative root. The square root s of number a is such that s*s = a. It is the opposite of squaring.
Parameters:
-
val
NumberThe value to be calculated
Returns:
startsWith
-
str
Checks whether a string starts with a specific character or string.
Parameters:
-
str
StringA string to be checked
Returns:
stories
-
doc
-
[cb]
If no callback function is given it returns a Collection of items otherwise calls the given callback function with each story of the given document.
Parameters:
-
doc
DocumentThe document instance to iterate the stories in
-
[cb]
Function optionalOptional: The callback function to call with each story. When this function returns false the loop stops. Passed arguments: story, loopCount;
Returns:
storyCount
()
Number
The number of all stories in the current document.
Returns:
stroke
-
strokeColor
Sets the color used to draw lines and borders around shapes.
Parameters:
-
strokeColor
Color | Swatch | NumbersAccepts a Color/swatch or a string with the name of a color. Or values: C,M,Y,K / R,G,B / Grey
strokeTint
-
tint
Sets the tint of the color used to draw lines and borders around shapes.
Parameters:
-
tint
NumberNumber from 0 to 100
strokeWeight
-
weight
Sets the width of the stroke used for lines and the border around shapes.
Parameters:
-
weight
NumberThe width of the stroke
tan
-
rad
Calculates the ratio of the sine and cosine of an angle. This function expects the values of the angle parameter to be provided in radians (values from 0 to PI*2). Values are returned in the range infinity to -infinity.
Parameters:
-
rad
Numbera value in radians
Returns:
text
-
txt
-
x
-
y
-
w
-
h
Creates a text frame on the current layer on the current page in the current document. The text frame gets created in the position specified by the x and y parameters. The default document font will be used unless a font is set with the textFont() function. The default document font size will be used unless a font size is set with the textSize() function. Change the color of the text with the fill() function. The text displays in relation to the textAlign() and textYAlign() functions. The width and height parameters define a rectangular area.
Parameters:
Returns:
textAlign
-
align
-
[yAlign]
Sets the current horizontal and vertical text alignment.
Parameters:
-
align
StringThe horizontal text alignment to set. Must be one of the InDesign Justification enum values: Justification.AWAYFROMBINDINGSIDE
Justification.CENTERALIGN
Justification.CENTERJUSTIFIED
Justification.FULLYJUSTIFIED
Justification.LEFTALIGN
Justification.RIGHTALIGN
Justification.RIGHTJUSTIFIED
Justification.TOBINDING_SIDE -
[yAlign]
String optionalThe vertical text alignment to set. Must be one of the InDesign VerticalJustification enum values: VerticalJustification.BOTTOMALIGN
VerticalJustification.CENTERALIGN
VerticalJustification.JUSTIFYALIGN
VerticalJustification.TOPALIGN
textFont
-
fontName
-
[fontStyle]
Returns the current font and sets it if argument fontName is given.
Parameters:
Returns:
textKerning
-
[kerning]
Returns the current kerning and sets it if argument kerning is given.
Parameters:
-
[kerning]
Number optionalThe value to set.
Returns:
textLeading
-
[leading]
Returns the spacing between lines of text in units of points and sets it if argument leading is given.
Parameters:
textSize
-
[pointSize]
Returns the current font size in points and sets it if argument pointSize is given.
Parameters:
-
[pointSize]
Number optionalThe size in points to set.
Returns:
textTracking
-
[tracking]
Returns the current tracking and sets it if argument tracking is given.
Parameters:
-
[tracking]
Number optionalThe value to set.
Returns:
transform
-
obj
-
matrix
Transforms the given PageItem with the given Matrix2D object.
Parameters:
-
obj
PageItemThe item to be transformed
-
matrix
Matrix2DThe matrix to be applied
transformImage
-
img
-
x
-
y
-
width
-
height
Transforms position and size of an image. The image fit options are always "contentToFrame".
translate
-
tx
-
ty
Specifies an amount to displace objects within the page. The x parameter specifies left/right translation, the y parameter specifies up/down translation. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling translate(50, 0) and then translate(20, 0) is the same as translate(70, 0). This function can be further controlled by the pushMatrix() and popMatrix().
trim
-
str
Removes whitespace characters from the beginning and end of a String. In addition to standard whitespace characters such as space, carriage return, and tab, this function also removes the Unicode "nbsp" character.
trimWord
-
s
Removes multiple, leading or trailing spaces and punctuation from "words". E.g. converts "word!" to "word". Especially useful together with b.words();
Parameters:
-
s
StringThe String to trim
typo
-
item
-
property
-
[value]
Sets text properties to the given item. If the item is not an instance the text property can be set to, the property gets set to the direct descendants of the given item, e.g. all stories of a given document.
If no value is given and the given property is a string, the function acts as a getter and returns the corresponding value(s) in an array. This can either be an array containing the value of the concrete item (e.g. character) the values of the item's descendants (e.g. paragraphs of given text frame).
Parameters:
-
item
Document | Spread | Page | Layer | Story | TextFrame | TextThe object to apply the property to.
-
property
String | ObjectThe text property name or an object of key/value property/value pairs. If property is a string and no value is given, the function acts as getter.
-
[value]
String | Number | Object optionalThe value to apply to the property.
unbinary
-
binaryString
Converts a String representation of a binary number to its equivalent integer value. For example, unbinary("00001000") will return 8.
Parameters:
-
binaryString
Stringvalue to convert
Returns:
unhex
-
hex
Convert a hex representation to a number.
Parameters:
-
hex
StringThe hex representation
Returns:
units
-
[units]
Sets the units of the document (like right clicking the rulers). The default units of basil.js are PT.
Parameters:
-
[units]
Constant optionalSupported units: PT, PX, CM, MM or IN
Returns:
Vector
-
x
-
y
-
[z]
A class to describe a two or three dimensional vector. This datatype stores two or three variables that are commonly used as a position, velocity, and/or acceleration. Technically, position is a point and velocity and acceleration are vectors, but this is often simplified to consider all three as vectors. For example, if you consider a rectangle moving across the screen, at any given instant it has a position (the object's location, expressed as a point.), a velocity (the rate at which the object's position changes per time unit, expressed as a vector), and acceleration (the rate at which the object's velocity changes per time unit, expressed as a vector). Since vectors represent groupings of values, we cannot simply use traditional addition/multiplication/etc. Instead, we'll need to do some "vector" math, which is made easy by the methods inside the Vector class.
Constructor of Vector, can be two- or three-dimensional.
Vector.add
-
v
-
[y]
-
[z]
Adds x, y, and z components to a vector, adds one vector to another.
Vector.angleBetween
-
v1
-
v2
Static function. Calculates the angle between two vectors. Is meant to be called "static" i.e. Vector.angleBetween(v1, v2);
Parameters:
-
v1
VectorThe first vector
-
v2
VectorThe second vector
Returns:
Vector.cross
-
v1
-
v2
Static function. Calculates the cross product of two vectors. Is meant to be called "static" i.e. Vector.cross(v1, v2);
Parameters:
-
v1
VectorThe first vector
-
v2
VectorThe second vector
Returns:
Vector.cross
-
v
-
[y]
-
[z]
Calculates the cross product from this vector to another as x, y, and z components or full vector.
Parameters:
Returns:
Vector.dist
-
v1
-
v2
Static function. Calculates the Euclidean distance between two points (considering a point as a vector object). Is meant to be called "static" i.e. Vector.dist(v1, v2);
Parameters:
-
v1
VectorThe first vector
-
v2
VectorThe second vector
Returns:
Vector.dist
-
v
-
[y]
-
[z]
Calculates the distance from this vector to another as x, y, and z components or full vector.
Parameters:
Returns:
Vector.div
-
v
-
[y]
-
[z]
Divides this vector through x, y, and z components or another vector.
Vector.dot
-
v
-
[y]
-
[z]
Calculates the dot product from this vector to another as x, y, and z components or full vector.
Parameters:
Returns:
Vector.dot
-
v1
-
v2
Static function. Calculates the dot product of two vectors. Is meant to be called "static" i.e. Vector.dot(v1, v2);
Parameters:
-
v1
VectorThe first vector
-
v2
VectorThe second vector
Returns:
Vector.get
()
Vector
Gets a copy of the vector, returns a Vector object.
Returns:
Vector.heading
()
Number
The 2D orientation (heading) of this vector in radian.
Returns:
Vector.limit
-
high
Normalizes the length of this vector to the given parameter.
Parameters:
-
high
NumberThe value to scale to.
Vector.mag
()
Number
Calculates the magnitude (length) of the vector and returns the result as a float
Returns:
Vector.mult
-
v
-
[y]
-
[z]
Multiplies this vector with x, y, and z components or another vector.
Vector.normalize
()
Normalizes the length of this vector to 1.
Vector.set
-
v
-
[y]
-
[z]
Sets the x, y, and z component of the vector using three separate variables, the data from a Vector, or the values from a float array.
Vector.sub
-
v
-
[y]
-
[z]
Substract x, y, and z components or a full vector from this vector
Vector.toString
()
String
Returns data about this vector as a string.
Returns:
vertex
-
x
-
y
-
[xAnchorLeft]
-
[yAnchorLeft]
-
[xAnchorRight]
-
[yAnchorRight]
Shapes are constructed by connecting a series of vertices. vertex() is used to specify the vertex coordinates lines and polygons. It is used exclusively within the beginShape() and endShape() functions.
Please use either vertex(x, y) or for drawing bezier shapes vertex(x, y, xAnchorLeft, yAnchorLeft, xAnchorRight, yAnchorRight). You can also mix the two approaches.
words
-
item
-
[cb]
If no callback function is given it returns a Collection of items otherwise calls the given callback function with each word of the given document, story, text frame, paragraph or line.
Parameters:
-
item
Document | Story | TextFrame | Paragraph | LineThe document, story, text frame, paragraph or line instance to iterate the words in
-
[cb]
Function optionalOptional: The callback function to call with each word. When this function returns false the loop stops. Passed arguments: word, loopCount
Returns:
Properties
FACING_BLEEDS
String
Used with b.canvasMode() to set the canvas to use the current facing pages plus bleeds.
FACING_MARGINS
String
Used with b.canvasMode() to set the canvas to use the current facing pages minus margins.
MARGIN
String
Used with b.canvasMode() to set the canvas to the full current page minus the margins.
MODEHIDDEN
String
Used with b.go() to set Performance Mode. Processes Document in background mode. Document will not be visible until the script is done. If you are firing on a open document you'll need to save it before calling b.go(). The document will be removed from the display list and added again after the script is done. In this mode you will likely look at indesign with no open document for quite some time - do not work in indesign during this time. You may want to use b.println("yourMessage") in your script and look at the Console in estk to get information about the process.
MODESILENT
String
Used with b.go() to set Performance Mode. Disables ScreenRedraw during processing.
MODEVISIBLE
String
Default mode. Used with b.go() to set Performance Mode. Processes Document with Screen redraw, use this option to see direct results during the process. This will slow down the process in terms of processing time. This mode was also the default in Versions prior to 0.22


SCAPE Planning Suite - Fast Track Evaluation - #{viewWorkflow.currentView.name}
Fast Track Evaluation - #{viewWorkflow.currentView.name}
Identification
Sample records
Objective tree
Identification
Sample Records
Has data:
MB
Objective Tree
Toggle Toolinfo


HighScores
Time Left:
Answer these questions as fast as you can!
Congratulations! Please submit your initials for the highscore board. Your final score is:
Wrong
Right
Main
Clear Scores


It is very preliminary at the moment. I’m constantly detailing out and advocating for help. All questions or edits are welcome!
TOC
Domi’s Story
In my humble opinion, it is how people communicate their thoughts and how people are organized to deliver
the biggest asset of human civilization.
Technologies like artificial general intelligence
and blockchain
are the byproducts (tools). Organizations like corporations
and governments
are the forms (means).
It is how everyone is valued and matched, to take ownership to develop, under aligned interest and agreed principles, that matters more.
More about Why: Initiatives on Sociological Practice
What’s Your Story To Keep You Up In The Morning?
What’s The Challenge Keeps You Up In The Night?
Domi’s Thoughts
Fundamental Trend: Larger educated populations are more frequently generating denser information through communication.
The Dilemma: Our adaptability (learning ability) are biologically limited, as
Alternative explanation: Cognitive Bandwidth issue, nailed by César Hidalgo with Augmented Democracy.
Direct Consequences: Information Overload that results in divergent cognitive abilities:
In together with the institutional barriers
detailed below, causes
anxiety
of career lock-in
due to solidified skill and experience with new tools and methods flushing in;sociological segregation
due to difficulties to trace the source of divergence:
fragmentation of Internet
that intensifies alienation;economic segregation
that raises concerns;I believe diversity
is liberal
and collaborative
, not discriminative or alienating.
Cause of Institutional Barriers
The free market is supposed to optimize the supply and demand without intervention. But information asymmetry naturally exists, which inspired capitalism to take advantage to build institutional barriers
. Such institutional barriers include, but not limited to military (politics, policies, ideologies), economics (capitals, market power, information), technology (patents, IPs, manufacturing techniques).
The economic and sociological segregations are then rationalized with Darwinism for the favor of politicians, capitalists, institutions that also fosters religionists, nationalists, racists, sexists, etc.
Any minority faces inequality bargaining power due to the information asymmetry caused by institutional barriers
.
To fill the gap of cognitive abilty and information asymmetry caused by such institutional barriers
, we need to re-confirm the root cause and find radical solutions.
Domi’s Plan
This part is still under reconstruction: 1. bottom-up way to demonstrate how it can be done; 2. top-down way to demonstrate why I think so. Both are illuminated in the mind note map.
Why? My motivation is covered earlier. I also realize that a collaborative society is worth living in that no matter who and how it’s been built. And one of the key principle is be open enough to embrace changes. AMA there because at one point, histories are being made regardless.
To break the institutional barrier
mentioned above, the radical solution will be improve the biological limit of adaptability. But biological changes don’t and won’t catch up with the timescale of societal evolution any more, due to the fundamental difference of information propagation speed.
Thus the only possibility I see is giving everyone the access to Augmented Decision AI
to augment one’s decision making ability in a process of Adaptive Learning
, which involves retrieving information from the collective knowledge base of human civilization and providing decision suggestions with reasonings, through wearable Human-computer Interface
based on the personal knowledge base, draft of the R&D plan. At the same time, the society needs to be organized with trust and principles to balance liberty
between individuals and communities.
Before diving into the detail, let’s step back and think about the cosmology of human history.
My abstraction of Industrial Revolution
& Renaissance
:
With that in mind, building an enterprise is one of the best ways to accumulate resources to empower people to be visionaries. It is also the only way to demonstrate the power of collaborative society when the current form of corporations and governments are reaching the ceiling of efficiency. As a community member with ownership (universal basic income + equity), individuals will be best motivated. With principles to let everyone keeps up and gets involved in decision based on the proved ability. We can focus on what’s important, to build a corporation as a government (society), to best liberate everyone’s productivity, to eventually create abundance for better tomorrow.
Revisit the Vision and be a part in finding the path towards future with us.
It sounds like a hopeless optimistic ideal. But it’s possible and I’m making it feasible. Smarter minds like you can join force with my road map, or propose a better path.
We will collaborate on building tools and methodologies for ourselves, other companies, corporations, governments to communicate efficiently and effectively.
Anyone should be a part of the collaborative society, which aims to provide help to liberate everyone, with equal access to the information and basic resources, until catching up by adaptive learning, to become capable, to extend the edge of the collective knowledge base.
TODO - [ ] explain about how to improve cognitive ability to take more responsibility. - [ ] write about similarity of marketing and education, the abuse of attention - [ ] effective autonomy: principle alignment, proposal oriented instead of group oriented, decentralized management with no opportunistic barrier, normalize peer review power.
All supports are recognized!
star
this project as pledge to supportRemember, remember, the principles to be a member.
A brief view of Principles in Construction
I know that I know nothing
.One can make the shape, but it is all together that can fill the gap.
Preliminary
Adaptive Education
Preliminary
The project is to build SaaS service to automate workflow from meeting, a voice based Salesforce system.
The data will be accumulated to develop workforce system like LinkedIn to better evaluate talents for hiring and management.
Privacy or business security is definitely a challenge but it could be taken care of with open sourcing, bet agreement, shares sharing, etc. The core idea is to be collaborative that using technology to empower people to communicate more efficient and effective. With the data generated, we can build enterprise knowledge base as well as personal knowledge base to model the proportional contribution and collective decision path, to power the development of AGI level automation to create manufacturing abundance for UBI.
At the same time, the proportional contribution could be the distribution incentive to motivate people to learn more from the enterprise knowledge base through practice in collective decision making.
By solving the communication scaling challenge and organization scaling challenge, we may surpass humans biological limit of adaptability for a collaborative society based on effective altruism.
In the big picture, guided by the Principle:
In the short term, detailed in Execution Plan:
Nothing is perfect but in Principles we unite. QA thread.
on-demand
? Will there be less material cost and inventory?made local
? Will there be less packaging and energy cost in logistics?specialized to customization
? Is choice abundance and personal affiliation a unfulfilled demand?Cost
?
Adaptive
? Can information density be adjusted to the personal knowledge base?Practical
? Can we learn from practice with the guide of the collective knowledge base?My peek to one of the loosely-pictured future.
I know that I know nothing
– Socrates


1 write to DollarUnder
System.Management.Automation (1)
engine\lang\scriptblock.cs (1)
1434
DollarUnder
= dollarUnder;
1 reference to DollarUnder
System.Management.Automation (1)
engine\lang\scriptblock.cs (1)
1062
eventArgs.
DollarUnder
,