# Secuencia de Apple Script para cambiar colores en Numbers

## Introducción

Puede que muchos no hallais conocido la época del Apple Script para todo, antes de que Steve Jobs, volviera a su casa y la llevara a donde ha llegado. En aquel entonces el Apple Script erá lo mejor para lo makeros frikis. Pro que te permitia cosas impensables en el mundo Windows o en el de linux con las X.

### Applescript para funciones de teclado

Para ir más rápido uso un herramienta imprescindible como makero friki: [BetterTouchTool](https://folivora.ai/) pero puedes apañartelas a pelo. Eso ya es otro cantar que no voya  explicar aqui.

### Secuencia

En este caso uso 3 secuencias para marcar filas o celdas en numbers, cuando ando con la contabilidad. Numbers es maravilloso, pero algunas cosas no son precisamente usables como esta y prefiero tener un secuencia de teclado para ir mas rápido.

Podeis modificar los colores pero recodsar usar el formato de color de mac

![BetterTouchTool](https://multimedia.castris.com/imagenes/wiki/macos/apple-script-numbers.jpg)

#### Color verde

```
tell application "Numbers"
    tell front document
        tell active sheet
            try
                set active_table to (first table whose class of selection range is range)
            on error
                display alert "No selection" buttons {"OK"} default button 1
                return
            end try
            tell active_table
                set background color of selection range to {0, 65535, 0}
            end tell
        end tell
    end tell
end tell
```

#### Color amarillo

```
tell application "Numbers"
    tell front document
        tell active sheet
            try
                set active_table to (first table whose class of selection range is range)
            on error
                display alert "No selection" buttons {"OK"} default button 1
                return
            end try
            tell active_table
                set background color of selection range to {65535, 65535, 0}
            end tell
        end tell
    end tell
end tell
```

#### Color rojo

```
tell application "Numbers"
    tell front document
        tell active sheet
            try
                set active_table to (first table whose class of selection range is range)
            on error
                display alert "No selection" buttons {"OK"} default button 1
                return
            end try
            tell active_table
                set background color of selection range to {65535, 17733, 14906}
            end tell
        end tell
    end tell
end tell

```

##### Aviso
Esta documentación y su contenido, no implica que funcione en tu caso o determinados casos. 
También implica que tienes conocimientos sobre lo que trata, y que en cualquier caso tienes copias de seguridad.
El contenido el contenido se entrega, tal y como está, sin que ello implique ningún obligación ni responsabilidad por parte de [Castris](https://castris.com)

Si necesitas soporte profesional puedes contratar con Castris [soporte profesional](https://intranet.castris.com/store/soporte-profesional).