AppleScript corrupted Apple Notes — safest recovery from offline iPad?

Unsolved

**TL;DR:** Ran a Python + AppleScript script using `set body` on ~449 Apple Notes on my M2 MacBook Air (latest macOS). It stripped formatting and turned all attachments (PDFs, scans, photos) into unopenable "file" icons across my synced devices (including iPhone 17 Pro on iOS 26). My iPad M5 Pro (iPadOS 26) is offline in Airplane Mode with the clean, intact notes. No Time Machine backup exists. How do I safely recover without iCloud wiping my iPad's good copy?

---

### What Happened
The script fetched note bodies and used `set body` to append/remove tags. Overwriting note bodies via AppleScript breaks attachment bindings and strips formatting in Apple Notes. No notes were deleted, just corrupted.

### Current State
* **M2 MacBook Air (latest macOS) & iPhone 17 Pro (iOS 26):** Corrupted and synced to iCloud.
* **iPad M5 Pro (iPadOS 26):** Intact / pre-corruption state (Airplane Mode, sync inert).
* **Backups:** No Time Machine. Have an iCloud device backup of the iPad from 1 day pre-corruption.

---

### Questions

  1. **Third-Party Extraction:** What is the best tool (e.g., iMazing) to extract Notes with attachments intact directly from the offline iPad M5 Pro or an iCloud backup without restoring the whole device?
  2. **Database Pull:** Is it feasible to pull `NoteStore.sqlite` from an iPad backup/extraction to restore manually?
  3. **iCloud Sync Risk:** If I delete the corrupted notes on iCloud/Mac and reconnect the iPad, will CloudKit treat the deletions as authoritative and wipe the iPad, or upload the iPad's good copy?
  4. **Best Practices:** What is the safest, zero-risk recovery strategy before reconnecting the iPad to the internet?

Thanks.

Posted Aug 12, 2026, 10:49 AM UTC

12
Loading comments…