Finder move folder not working anymore

I have this script which ask the user to select a folder in the Downloads folder and move the selected one to another location. This script use to work under Mojave and stop under Catalina 10.15.3

Here’s the source

set inFolder to path to “down”
tell application “Finder”
set outFolder to “Macintosh HD:Users:INorm:Documents”
set folderNAME to choose folder default location inFolder
move folderNAME to outFolder with replacing
end tell

what’s changed in Catalina to make it stop ?

the result is: error “Finder error : The handler AppleEvent failed.” number -10000

Thank you

CarNorm. I tested the script on my computer under Catalina with Script Editor, and it worked fine. You may want to try the following version but I suspect you’ll get the same result.

set outFolder to "Macintosh HD:Users:INorm:Documents:" as alias
set folderNAME to choose folder

tell application "Finder"
	move folderNAME to outFolder with replacing
end tell

Under Catalina you may have to grant the script authorization to access the Downloads folder, depending on how the script is run. Try running the script in Script Editor and see what happens.

Also, take a look in:

System Preferences > Security & Privacy > Privacy > Files & Folders

On my computer, Script Editor has “Full Disk Access” and AppleScript apps that access the Downloads folder have this enabled.

One important way in which peavine’s script differs from the original is that the destination is a specifier (in this case an alias), not just a piece of text. Assuming that the Downloads and Documents folders belong to the same user on the same machine, the code might be written as below — but I’ve only been able to try it in Mojave:

set inFolder to (path to downloads folder)
set outFolder to (path to documents folder)

tell application "Finder"
	set folderNAME to (choose folder with prompt "Select a folder to move to your Documents folder …" default location inFolder)
	move folderNAME to outFolder with replacing
end tell

The solution of Nigel Garvey work as expect.

Is there an explanation why it does not work in Catalina the way I wrote my script ?

Even without explanation, thank for your solution. I can move on now.

I don’t know, what happens with Catalina 10.15.3, but on the Catalina 10.15.4 your original script works as expected. Although it has clumsy syntax, the new Catalina completely coped with it. Look how smart is it! :frowning:

I’m also on Catalina 10.15.4 and all three scripts in this thread work for me. It’s just a guess, but I wonder if the OP’s outFolder path is correct, which is one explanation as to why Nigel’s script would work but the others wouldn’t.

BTW I was surprised that the following works but it does:

set inFolder to path to "down" --> alias "Macintosh HD:Users:Robert:Downloads:"

The text in OP post he say downloads folder…

So the correct syntax is the way Nigel did it…

If the OP script did work in Catalina 10.15.4, and ‘down’ is same as ‘download’ I think its a bug.

hahaha, that said, I try on my Mojave path to “down” and it gave me the path to downloads.

  1. AppleScript Language Guide didn’t say anything about this. — checked.

  2. AppleScript Finder Guide didn’t say anything about this. – checked.

So I guess its maybe alias that is not documented.

This works to…

path to “desk”

I don’t think so. Anyone can’t get Scripting Additions documentation newest than last years. I know 1 thing from old documentations: path to command does some attempts to find the correct location when the user breaks the syntax. For example, the following command shows the location of the currently edited script:

path to 

There are text alternatives for most of the path to folders and for a few more which don’t have keywords. But I think they’re mostly obsolete now. They all have four letters and are seen as four-byte tokens rather than as text. You can use «class down» instead and it’ll still work. However, the token for the Downloads folder nowadays is «constant afdrdown», which compiles as downloads folder, so this is to be preferred!

OK, what you can say for this:

set myEditedScript to path to

The first run will give you the last path, the second run will give you path to the script…

It’s not a bug.
It’s an official ‘short name’ for the download folder.

Look at : “”

Here is just a small part of this file:

  kAudioVSTFolderType           = 'avst', /* Refers to the VST subfolder of the Audio Plug-ins folder*/
  kColorPickersFolderType       = 'cpkr', /* Refers to the ColorPickers folder*/
  kCompositionsFolderType       = 'cmps', /* Refers to the Compositions folder*/
  kFontCollectionsFolderType    = 'fncl', /* Refers to the FontCollections folder*/
  kiMovieFolderType             = 'imov', /* Refers to the iMovie folder*/
  kiMoviePlugInsFolderType      = 'impi', /* Refers to the Plug-ins subfolder of the iMovie Folder*/
  kiMovieSoundEffectsFolderType = 'imse', /* Refers to the Sound Effects subfolder of the iMovie Folder*/
  kDownloadsFolderType          = 'down' /* Refers to the ~/Downloads folder*/

enum {
  kColorSyncProfilesFolderType  = 'prof', /* for ColorSync™ Profiles */
  kApplicationSupportFolderType = 'asup', /* third-party items and folders */
  kTextEncodingsFolderType      = 0xC4746578/*'ƒtex'*/, /* encoding tables */
  kPrinterDescriptionFolderType = 'ppdf', /* new folder at root of System folder for printer descs. */
  kPrinterDriverFolderType      = 0xC4707264/*'ƒprd'*/, /* new folder at root of System folder for printer drivers */
  kScriptingAdditionsFolderType = 0xC4736372/*'ƒscr'*/ /* at root of system folder */

you may test with

path to "flow"
path to "simp"
path to "empz"
path to "prof"
path to "asup"
path to "avst"
path to "cpkr"
path to "fncl"

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 29 mars 2020 21:17:07

Yes, it works, and should work in the future. The bug will if they will not work:

path to "desk" -- desktop
path to "cusr" -- home
path to "docs" -- documents
path to "mdoc" -- movies
path to "pdoc" -- pictures
path to "µdoc" -- music
-- and so on...

and this:

path to

is path to current file. It is equivalent to path to me.

path to "pref" -- preferences folder
path to "scrƒ" -- scripts folder

short name… for what… lazy people who type to slow…

I like long names that tell me what the code does… that is more meaningful but also for others.

Yes, yes, for the lazy. :lol:

However, for a programmer, this is a great opportunity to provide a compact list of folders in which you need to find something. Without searching the rest.