How do I make a string into a path?

DJ is right

"Disk:path:to:whatever" as alias

throws always an error if the item does not exist.

Hello.

I agree to that, but you can’t assume that an alias allways will throw an error if it doesn’t point to a valid file.

I tried that within some tell blocks, and outside some tell blocks, and there were allways thrown an error.

It is still worth mentioning, that unless you coerce something to an alias directly, you shouldn’t rely upon the file behind the alias to exist, because it is an alias.:slight_smile:

You can

We are talking about the AppleScript alias specifier which is NOT equal to a Finder alias.
The AppleScript equivalent of a Finder alias is alias file

But as in my example in post #17 you can see how I check if the alias is broken or not. When the alias is broken it will throw an error so you don’t need to check the for existence yourself, the alias does. However, because an alias follows a file if you move it or rename it the alias can point to an file that has been renamed while another newer file contains the original name. Still, the alias points to an existing (read:original) file.

Is there an possibility that you mixed up that an alias doesn’t need to exists at compile time since Leopard? It’s a new feature since AppleScript 2.0. In earlier versions of AppleScript the alias needed to exists at compile time too, since AppleScript 2.0 only at run time.

Hello.

I am not thinking of compile time aliases, and the way DJ Bazzie Wazzie and kel did it, seem to allways throw an error.

What I have in mind is what Stefan mentiones above, that other apps, maybe also defines an alias class, that doesn’t necessarily work like the alias of AppleScript.

But I seem to remember that the issue was here sometime during last summer or autumn, I’ll have a look back. If not for any other reason, so to clear up my own confusion. :slight_smile:

Just for the record: Then it has nothing to do with Leopard as you suggested but with an application that overrides the alias class.

That is true.

I may have mixed the two issues. It is around or over 3 years ago it happened to me, and I can’t recall the exact circumstances, but I most definetively had an alias within a tell BBEdit block, that just didn’t exist, without any error thrown.

Well, I’m not going back, too look for that post. I wonder if it can be that some applications relaxes run time error handling? They aliases get to be resolved when the app is targetted.

I am not sure about this, but I don’t trust aliases, apart from the direct coercion.

Edit

I think I somehow obtained the alias from Finder, but I am not sure, it was edited away three years ago.