Skip to content

Instantly share code, notes, and snippets.

@keithyipkw
keithyipkw / gist:15e1f6c95af08dda5de1
Last active September 15, 2015 03:24
AppleScript of exporting unread emails and attachments to a folder
set theOutputFolder to (choose folder) as string
tell application "Mail"
set theMessages to (messages of mailbox "mailbox name" of account "account name" whose read status is false)
repeat with theMessage in theMessages
try
set theSender to extract name from sender of theMessage
set {year:y, month:m, day:d, hours:h, minutes:min, seconds:s} to theMessage's date sent
set subFolder to ("" & theSender & " " & y & my pad(m as integer) & my pad(d) & "T" & my pad(h) & my pad(min) & my pad(s))
tell application "Finder"
@keithyipkw
keithyipkw / symbolicatecrash.patch
Last active October 6, 2020 10:05
A dirty fix for crash log symbolication in Xcode
# This patch will force symbolicatecrash to use dSym in atos instead of using release build executables.
#
# After setting the Xcode archive folder to one that outside Library (hidden), Spotlight will find the archives but Xcode still cannot symbolicate crash logs using the archives. If you find some similar errors in the STDERR from symbolicatecrash using the following command, this patch will help
# DEVELOPER_DIR=`xcode-select -print-path` /Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash -v -o <symbolicated.crash> <input.crash> 2>v.log
#
# 1 binary images were found.
# Running /Applications/Xcode.app/Contents/Developer/usr/bin/atos -arch armv7 -l 0x82000 -o '<app name>.xcarchive/Products/Applications/<app name>.app/<app name>' <some addresses> |
# ## Warning: Unable to symbolicate from required binary: '<app name>.xcarchive/Products/Applications/<app name>.app/<app name>'
#
# To apply the patch