Is it possible to wrap this cocoa snippet into a script? I don’t have 10.6 to develop on yet.
Not an application just a stand alone script if possible.
Shane, thanks! Wow that’s awesome. I must give you major props, you’re so knowledgeable on Scritpting and various other aspects. My coworkers think I’m smart, but compared to you, I feel sorta dumb sometimes. I truly thank you for your assistance and continued participation on this forum.
Running this in Terminal, how can I use the path with spaces? I tried it with single quotes and double quotes, with and without “file://”. I know in my Applescript I’m gonna have a path that has spaces in it. Every time I try with a path that has a space it never works (in Terminal).
–Edit: OK I think I see what’s up. I need to escape out spaces before it hits NSURL. Will try in 2 seconds.
Strings with spaces in the terminal have to be surrounded by quotes (or a backslash '' has to precede every space).
do shell script quoted form of "/path/to/new_name " & quoted form of "file:///Users/bjh/Desktop/temp.m" & space & quoted form of "file:///Users/bjh/Desktop/myalias"
Hope it helps,
ief2
EDIT:
Since POSIXes are more common in AppleScript, I suggest converting the POSIXes to URLs in the CLU:
Call it like this
set srcFile to POSIX path of (choose file with prompt "Source")
set destFile to POSIX path of (choose file with prompt "Destination")
do shell script (quoted form of "/path/to/new_name ") & quoted form of srcFile & space & quoted form of destFile