Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Make any folder a burn folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Make any folder a burn folder
Authored by: mark hunte on Sep 23, '05 02:15:01PM
This works in Automator. ( or hot key applescript ) it lets you choose to make burn folder or un burn folder. you can break them down if you want to two separate actions.
display dialog "Make Burn Folder OR un-Burn Folder" buttons {"Burn Folder", "un-Burn Folder", "cancel"} default button 1
if the button returned of the result is "Burn Folder" then
	my _burn_folder()
else if the button returned of the result is "un-Burn Folder" then
	my Un_burn_folder()
	
else
	
end if


on _burn_folder()
	try
		tell application "Finder"
			set sourceFolder to selection as alias
			set sourceFolder to sourceFolder as string
			set sourceFolder to POSIX path of sourceFolder
			set burn_name to do shell script "echo " & quoted form of sourceFolder & " " & " |awk -F" & last word of sourceFolder & " '{print $1}'"
			set burn_name to burn_name & last word of sourceFolder & ".fpbf" as string
			
			do shell script "mv " & quoted form of sourceFolder & " " & quoted form of burn_name
		end tell
	on error
		set error_message1 to "Select a Folder,  before running the script."
		display dialog error_message1 buttons {"OK"} default button 1
	end try
end _burn_folder

on Un_burn_folder()
	try
		tell application "Finder"
			set burn_name to selection as alias
			set burn_name to burn_name as string
			set burn_name to POSIX path of burn_name
			
			set sourceFolder to do shell script "echo " & quoted form of burn_name & " " & " |awk -F.fpbf '{print $1}'"
			
			
			do shell script "mv " & quoted form of burn_name & " " & quoted form of sourceFolder
		end tell
	on error
		set error_message1 to "Select a Folder,  before running the script."
		display dialog error_message1 buttons {"OK"} default button 1
	end try
	
end Un_burn_folder

---
mh

[ Reply to This | # ]

10.4: Make any folder a burn folder
Authored by: mark hunte on Sep 23, '05 02:47:50PM
Actually This is better, if the folder is already a burn folder this will change it back. If not then this will change it into one
tell application "Finder"
	try
		set source_Folder to selection as alias
		set source_Folder to source_Folder as string
		set source_Folder to POSIX path of source_Folder
		
		if the last word of source_Folder is "fpbf" then
			my Un_burn_folder()
		else
			my _burn_folder()
			
		end if
		
	on error
		set error_message1 to "Select a Folder,  before running the script."
		display dialog error_message1 buttons {"OK"} default button 1
	end try
end tell
on _burn_folder()
	
	tell application "Finder"
		set sourceFolder to selection as alias
		set sourceFolder to sourceFolder as string
		set sourceFolder to POSIX path of sourceFolder
		set burn_name to do shell script "echo " & quoted form of sourceFolder & " " & " |awk -F" & last word of sourceFolder & " '{print $1}'"
		set burn_name to burn_name & last word of sourceFolder & ".fpbf" as string
		
		do shell script "mv " & quoted form of sourceFolder & " " & quoted form of burn_name
	end tell
	
end _burn_folder

on Un_burn_folder()
	
	tell application "Finder"
		set burn_name to selection as alias
		set burn_name to burn_name as string
		set burn_name to POSIX path of burn_name
		
		set sourceFolder to do shell script "echo " & quoted form of burn_name & " " & " |awk -F.fpbf '{print $1}'"
		
		
		do shell script "mv " & quoted form of burn_name & " " & quoted form of sourceFolder
	end tell
	
	
end Un_burn_folder

---
mh

[ Reply to This | # ]