choose folder vs direct path

Hey, sorry looked all over for an answer to this.

When I us set backupFolder to (choose folder)

I get a dialog that works perfectly to open a folder.

However, if I use an absolute path it errors saying Can’t get every folder of [folder path]

Here’s my script:

set backupFolder to "/Users/kr3/Desktop/Testing"
tell application "Finder" to set theseFolders to (get folders of backupFolder)
repeat with oneFolder in theseFolders
	if (modification date of (info for oneFolder as alias) < (current date) - 3 * hours) then
		tell application "Finder" to delete oneFolder
	end if
end repeat

Any help much appreciated from this n00b

Hi,

this is a very common error.
AppleScript works with HFS paths (colon separated)
and use the keyword folder or coerce the string to an alias


set backupFolder to "Mac HD:Users:kr3:Desktop:Testing:"
-- or: set backupFolder to  ((path to desktop as text) & "Testing:")
tell application "Finder" to set theseFolders to (get folders of folder backupFolder)
repeat with oneFolder in theseFolders
	if (modification date of (info for oneFolder as alias) < (current date) - 3 * hours) then
		tell application "Finder" to delete oneFolder
	end if
end repeat