# ProfileLoad

`com.jsmacrosce.jsmacros.core.event.impl.EventProfileLoad`

**Since:** 1.2.7

**Cancellable:** No. Calling `event.cancel()` throws `UnsupportedOperationException`.

Fires after a profile's script triggers have been registered, including at startup and on profile
switches. Script event listeners remain registered when triggers are replaced, so listeners can
observe subsequent loads. No event is fired when the profile has no trigger list; a missing profile
is created with an empty list and does fire this event.  
```js
// The default profile's index.js can register a listener for later profile switches.  
JsMacros.on("ProfileLoad", JavaWrapper.methodToJava(function (event) {
  Chat.log(`"${event.profileName}" is ready, setting the rest of the profile up`);  
}));  
```

## Constructors

### new EventProfileLoad {#com.jsmacrosce.jsmacros.core.event.impl.EventProfileLoad_constructor-BaseProfile-String-}

```js
new EventProfileLoad(BaseProfile profile, String profileName)
```

Initializes this event with the source profile's runner and stores the supplied profile name.

**Parameters:**
- `profile`: source of the event core
- `profileName`: name stored in the event payload

## Fields

### profileName {#com.jsmacrosce.jsmacros.core.event.impl.EventProfileLoad_profileName}

```js
profileName: String
```

The name of the profile that was loaded.

## Methods

### toString {#com.jsmacrosce.jsmacros.core.event.impl.EventProfileLoad_toString-}

```js
toString(): String
```

Returns diagnostic text naming this event and its profile, formatted as
`eventName:{"profileName": profileName}`. This is not a JSON serialization contract.

**Returns:** diagnostic text naming the event and profile
