# marshyswamp/save-restore-photoshop-session architecture

> Architecture diagram of the GitHub repository marshyswamp/save-restore-photoshop-session, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marshyswamp/save-restore-photoshop-session
- Repository: https://github.com/marshyswamp/save-restore-photoshop-session

## Overview

Project Type: This is an Adobe Photoshop Extension/Script project consisting of two ExtendScript (.jsx) files that work together to provide session management functionality.

##### Main Components

a. User Interface Layer:
- Photoshop Application Interface
- Script Menu Integration Points

b. Script Components:
- Save Session Script Component
- Restore Session Script Component
- Session Log File Component

##### Flow and Relationships

Save Flow:
- User initiates "Save Session" script
- Script scans open documents
- Script creates log file with document paths
- Script closes documents

Restore Flow:
- User initiates "Restore Session" script
- Script reads log file
- Script reopens documents
- Script activates last active document

Use these visual elements:

##### Technical Details
- ExtendScript Runtime Environment
- File System Integration Points
- Document Management APIs
- Session State Management

**[Photoshop Application]**
- ↕
**[Script Menu Interface]**
- ↕
**[Save Script] ←→ [Restore Script]**
- ↕           ↕
- [Session Log File]

Key Considerations:

##### File system integration points

Additional Notes:
- Notes about the limitations (window sizes, pan, zoom not preserved)
- Sequential nature of the save/restore process

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Adobe Photoshop Environment"
        PS[Photoshop Application]:::photoshop
        UI[Script Menu Interface]:::ui
    end

    subgraph "Script Components"
        SS["Save Session Script"]:::script
        RS["Restore Session Script"]:::script
    end

    subgraph "Storage Layer"
        LOG[(Session Log File)]:::storage
    end

    %% Main Flow Connections
    PS --> UI
    UI --> SS & RS
    SS --> LOG
    RS --> LOG
    LOG --> RS
    RS --> PS

    %% Save Flow
    SS -.->|1. Scan Documents| PS
    SS -.->|2. Create Log| LOG
    SS -.->|3. Close Documents| PS

    %% Restore Flow
    RS -.->|1. Read Log| LOG
    RS -.->|2. Reopen Documents| PS
    RS -.->|3. Activate Last| PS

    %% Click Events
    click SS "https://github.com/MarshySwamp/Save-Restore-Photoshop-Session/blob/main/Photoshop Session - 1 of 2 - Save.jsx"
    click RS "https://github.com/MarshySwamp/Save-Restore-Photoshop-Session/blob/main/Photoshop Session - 2 of 2 - Restore.jsx"

    %% Styles
    classDef photoshop fill:#4a90e2,stroke:#2171c7,color:white
    classDef ui fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef script fill:#2ecc71,stroke:#27ae60,color:white
    classDef storage fill:#f1c40f,stroke:#f39c12,color:black

    %% Legend
    subgraph Legend
        L1[Photoshop Components]:::photoshop
        L2[Interface Elements]:::ui
        L3[Script Components]:::script
        L4[(Storage Components)]:::storage
    end

    %% Version Info
    subgraph "Version Information"
        V1[Compatible with Photoshop CC]:::ui
    end
```
