Help with path to desktop and moving file

I am trying to find a file on my desktop and move it into another folder. I have already saved the name of the file into the following

set confirmationof to (path to desktop folder as text) & confirmationo & confirmationofp & ".pdf"

alias confirmationof


tell application "Finder"
	move confirmationof to filePath
end tell

I am getting the following error on the alias command

why isn’t the file found?

My guess is that there is no such a file ( confirmationof.pdf ) on your desktop.

Yvan KOENIG (VALLAURIS, France) jeudi 22 avril 2010 22:30:20

Try this:

tell application "Finder"
set confirmationof to ((path to desktop folder as  text) & "confirmationof.pdf")
move confirmationof to (path to documents folder as text)
end tell

That gives me an error

doesn’t it have to be an alias?
The file is there on the desktop, I can visually see it and it’s created in the previous section of the script.

I tested the script I posted and it worked, but you can also add “as alias” to the file path, like this:

tell application "Finder"
	set confirmationof to ((path to desktop folder as text) & "confirmationof.pdf") as alias
	move confirmationof to (path to documents folder as text)
end tell

I am frankly unsure why you are getting an error, but I believe error number -1700 is the “file doesn’t exist” error.

well, you are correct that your script does work, however I have reduced my original script that I presented here.
The file does exist on the desktop and when I alter your script to match the additional file path to the proper folder, It does move the file from the desktop to the new folder. In my script the step prior is to save the page as a pdf and I have tested it now with delays to make sure it was occurring at the proper time. I am adding a path in text to one that is a time stamp with the colons and other punctuation removed using TID from the title. My previous script that worked on leopard had

set confirmationof to (path to desktop folder as unicode text) & confirmationo & confirmationofp & ".pdf"

I have also tried with and without the alias command. I have also looked separately at the string in each part and the combined string and it seems to match.
Is it possible it is the way I am calling out the file and path?

You’re not setting up the path correctly. You need to enclose the entire path with parentheses, and put quotes around the rest of the path:

set confirmationof to ((path to desktop folder as text) & "confirmationo:confirmationofp.pdf")

Hi Caleb.

I apologize but


set confirmationof to (path to desktop folder as text) & "confirmationo:confirmationofp.pdf"

is perfectly correct and behaves flawlessly.

Here I post a script which does tha same but may be used as is on evey machine.


set thePath to (path to applications folder as text) & "Utilities:Activity Monitor.app"
tell application "Finder"
	thePath as alias
end tell

Here it returns :

alias “Macintosh HD:Applications:Utilities:Activity Monitor.app:”

Yvan KOENIG (VALLAURIS, France) vendredi 23 avril 2010 19:16:42