Author |
Message |
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
I have some scripts here, and upt to (and including Leopard), they work fine. In snow Leopard, they fail. This is the kind of code that is causing an error: Yes, the file planet.jpg is on my desktop. I’ve tried it on a Leopard Mac here, and it works. In Snow leopard, it gives an error. Is this something anyone else knows about and has managed to overcome?
|
Mon Sep 07, 2009 5:03 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
What error does it give?
|
Mon Sep 07, 2009 5:18 pm |
|
 |
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
|
Mon Sep 07, 2009 5:21 pm |
|
 |
big_D
What's a life?
Joined: Thu Apr 23, 2009 8:25 pm Posts: 10691 Location: Bramsche
|
On my machine, it got rid of "drivename:Users:", it started with the username.
_________________ "Do you know what this is? Hmm? No, I can see you do not. You have that vacant look in your eyes, which says hold my head to your ear, you will hear the sea!" - Londo Molari
Executive Producer No Agenda Show 246
|
Mon Sep 07, 2009 7:06 pm |
|
 |
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
You get the same error with this AppleScript: It takes a file you have chosen, turns it into a string, and then tries to turn it back to a file reference. This way, you get a reference to a real file to work with.
|
Mon Sep 07, 2009 7:27 pm |
|
 |
KindaWobbly
Occasionally has a life
Joined: Thu Apr 23, 2009 9:19 pm Posts: 101
|
Using your code in Snow Leopard gives me the same error you are getting. Assuming there's a reason why you want it to return a file reference rather than an alias, you can get the same result in 10.6 with something like this:
|
Mon Sep 07, 2009 11:51 pm |
|
 |
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
HI, What I am doing is fixing a Freeway Action. The Action takes a file reference from Freeway, drops it in some AppleScript and runs it. The file reference I get from Freeway is not a POSIX file - it’s a colon separated path.
Anyho, the good news is that using as alias instead of as file specification (Which I have just learned was deprecated a while back) seems to fix the problem. Thanks all.
|
Tue Sep 08, 2009 8:43 am |
|
 |
Nick
Spends far too much time on here
Joined: Thu Apr 23, 2009 11:36 pm Posts: 3527 Location: Portsmouth
|
Ah - boom boom pow! Glad to hear it's fixed. 
_________________
|
Tue Sep 08, 2009 11:05 am |
|
 |
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
Just need to test pn the other half’s iMac - which is PPC so is running Leopard. If it}s OK on that, I can get an update out. I’d hate to have to start writing Snow Leopard exceptions into the code.... 
|
Tue Sep 08, 2009 11:17 am |
|
 |
KindaWobbly
Occasionally has a life
Joined: Thu Apr 23, 2009 9:19 pm Posts: 101
|
Using an alias is almost certainly the best way. I'll confess I don't know what a Freeway Action is, and not that it matters anymore, but the code you posted was taking the, colon separated, alias reference from the original set > choose file command and turning it into a colon separated file reference. The workaround I suggested would achieve the same thing by taking the alias, colon separated path, turning into a POSIX path and then back again - this time into into a file reference rather than an alias. Illustration of my rather garbled explanation: 
|
Tue Sep 08, 2009 9:16 pm |
|
|