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


Click here to return to the 'Move selected items into ready-to-rename folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Move selected items into ready-to-rename folder
Authored by: amaloney on Apr 03, '09 07:43:25AM

Mark

I know almost nothing about writing AppleScripts

(1) With your modification what would the revised script be?

(2)No one has replied to your question about quitting System Events?
Have you altered this part of the script?
If so, what did you do?

Al Maloney



[ Reply to This | # ]
Move selected items into ready-to-rename folder
Authored by: mark hunte on Apr 03, '09 09:29:31AM
Its a simple change. Also I would take out the quit. there is no need for it and it may cause problems.
(*
Move items into new folder
Author: Barry Els
Version: 1.1
*)

tell application "Finder"
	try
		
		set theSelection to selection
		
		set currentPath to container of (the first item of the theSelection) as alias
		set parentPath to currentPath
		try
			
			set newFolder to (my createFolder(parentPath))
			move theSelection to newFolder
			
			delay 0.1
			set selection to newFolder
			---tell application "Finder" to activate --- for testing
			tell application "System Events"
				
				keystroke return
			end tell
			
		end try
		
	on error
		(*
    no folder or file is selected, warn the user
    *)
		
		display dialog ("Please select one or several items to group" & (theSelection as string))
		
	end try
	
end tell

on createFolder(selectedPath)
	tell application "Finder"
		set createdFolder to make new folder at selectedPath
	end tell
	
	return createdFolder
end createFolder 

---
mh

[ Reply to This | # ]