Skip to content

Instantly share code, notes, and snippets.

View Clustmart's full-sized avatar

Paul Wasicsek Clustmart

View GitHub Profile
@Clustmart
Clustmart / export-safari-bookmarks.swift
Last active July 14, 2024 11:52
Export Safari bookmarks and folder structure to ~/bookmarks.csv
import Foundation
// Define the file path to save the CSV
let filePath = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("bookmarks.csv")
// Create the CSV file if it doesn't exist
if !FileManager.default.fileExists(atPath: filePath.path) {
FileManager.default.createFile(atPath: filePath.path, contents: nil, attributes: nil)
}