# GoodNotes 6 匯出錄音檔(iPad+Mac) 環境:iPad Air 2024 + MacAir (macOS Sequoia) 1. 分享與匯出筆記本 * ! 2.以 GoodNotes格式 匯出 *  3.Airdrop 至 Mac *  4.將檔案解壓縮 *  5.開啟 檔案夾中的 attachments *  6.檢視檔案資訊 * (少量時) 用 Terminal 查看並改檔名 * 開啟 Terminal 輸入 `file <path>` *  * 將檔案為 Media MP4 的副檔名改為 .mp4 即可 * (大量時) 用 python 批次檢查並改檔名 * ``` import os import subprocess # 定義要讀取的文件夾路徑 folder_path = '/Users/chiehfang/Downloads/Meeting/attachments' # 迭代讀取文件夾中的所有檔案 for root, dirs, files in os.walk(folder_path): for file_name in files: # 取得檔案的完整路徑 file_path = os.path.join(root, file_name) # 使用 subprocess 執行 file 終端命令來取得檔案資訊 try: result = subprocess.run(['file', file_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) if result.returncode == 0: print(f"檔案資訊: {result.stdout}") if "MP4" in result.stdout: current_extension = os.path.splitext(file_name)[1] # 檢查是否需要改副檔名 if current_extension.lower() != '.mp4': # 定義新的檔名 new_file_name = os.path.splitext(file_name)[0] + '.mp4' new_file_path = os.path.join(root, new_file_name) # 重命名檔案 os.rename(file_path, new_file_path) print(f"已將檔案 {file_name} 更名為 {new_file_name}") else: print(f"檔案 {file_name} 已經是 .mp4 格式,無需更名。") else: print(f"檔案 {file_name} 不是 MP4 格式。") else: print(f"錯誤: {result.stderr}") except Exception as e: print(f"執行命令時發生錯誤: {e}") ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up