Buy Now and unlock this series
$
39
.99
$
24
.99
yours forever
$
39
.99
$
24
.99
Become a Pro and unlock everything
$
24
.99
per month
$
24
.99
Reading A File
I’ll be showing how you can add a file to the Main process using our new Menu skills to trigger a function to open and read a file. You’ll learn some of the core functions that will enable you to read entire directories-worth of files and edit, modify, save, and create new files.
Downloads
Become a pro to download code and videos
Level 1 Electron
22 videos
Course Instructor
Scott Tolinski
- Intro
3M2S - Getting Started With Electron
12M55S - Core Electron Concepts
8M47S - Working With Menus
12M18S - Menu Actions & Dev Tools
10M50S - Reading A File
13M56S - Communicating Between Main and Renderer with IPC
13M51S - Loading and Editing Our File
6M46S - Styled Components and Project Styling
10M40S - Customer Headers In Electron
8M53S - Opening A Directory
14M18S - User Settings with Electron Settings
11M26S - Loading Our Directory
12M14S - React Dev Tools
4M13S - Loading Files From Our Directory
11M34S - Saving Files On File Change
8M26S - Save File With Shortcut
10M37S - File Dates & Titles
9M8S - Date-fns & Sorting
8M52S - Creating New Files
20M47S - Building Our App
27M54S - Where To Go From Here
2M51S
Comments
N. SK
over 1 year ago
@Chris Borchert's solution worked for me as well. Would be great to have an updated video series @LevelUp
Blake
almost 2 years ago
@Chris Borchert That's exactly what I experienced as well; using dialog.showOpenDialog() actually throws errors with the file path that's returned not being a string. Adding a global mainWindow ( let mainWindow ), since reviewing Scott's course repo shows that I missed that step in a video, plus using dialog.showOpenDialogSync() resolved any issues I had using the current version of electron.js.
Chris Borchert
about 2 years ago
Any one else having any issues using a newer version of Electron should either make sure to have the correct version of electron or use dialog.showOpenDialogSync() instead of dialog.showOpenDialog(), since dialog.showOpenDialogSync returns a Promise now.
Want to join the conversation?
Become a Pro member today!