Skip to content

From Burn Folder to USB Memory Stick [OS X]

Following AppleScript replaces alias' (in a burn folder or so) with actual files. This comes in handy if you don't want to burn that folder to a CD/DVD but instead have it with you on a USB stick or an external drive.


--SCRIPT
on run
--main((choose folder with multiple selections allowed) as list)
main((choose folder) as list)
end run

on open aa
main(aa)
end open

on main(aa)
-- confirmation for safety
set AppleScript's text item delimiters to {ASCII character 0}
set aa to (aa as Unicode text)'s text items
set AppleScript's text item delimiters to {""}
set aa to (choose from list aa default items aa ¬
with prompt ("You're replacing alias files in following folder(s).") ¬
with multiple selections allowed)
if aa = false then error number -128

-- replace every alias file in given folders with its original item
set k to 0
repeat with a in aa
set a to a as alias
tell application "Finder"
tell item a
if its class is folder then
tell alias files
set rr to original item
delete
end tell
duplicate rr to it
set k to k + (count rr)
end if
end tell
end tell
end repeat
tell application "Finder" to empty trash

-- decent notice
tell application (path to frontmost application as string)
display dialog ("Total of " & k & " alias file(s) replaced successfully.") ¬
with icon 1 giving up after 5
end tell
end main
--END OF SCRIPT

Via From alias to real file: Apple Support Communities.