Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Mac > Xcode
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Xcode section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 12th, 2006, 04:55 PM
Registered User
 
Join Date: Apr 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Applescript - creating an alias to a file

On Mac OS X 10.4.6 -
Does anyone know how to create an Applescript that creates an alias of a file on the desktop or other location? I want to create an alias of a file in the /Applications/Test folder on my startup disk on the desktop. The file is called test1.rtf.

I have tried:
tell application "Finder"
    make new alias file to "/Applications/Test/test1.rtf" of startup disk at desktop
end tell

and also

tell application "Finder"
activate
make new alias file to "test1.rtf" of the folder "/Applications/Test/" of the startup disk at desktop
end tell

In each case I get this error:
Can't get "test1.rtf" of the folder "/Applications/Test/" of the startup disk. Access not allowed.

I suspected the issue was with the permissions to the file or the folder it is in, but making them 777 did not fix the issue. Could it be an issue with the privileges to the startup disk itself?
Does anyone know how to do this?

Thanks!
Bill

  #2 (permalink)  
Old May 12th, 2006, 06:03 PM
Registered User
 
Join Date: Apr 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok - this one was solved with the help of waltr on MacScripter - in case you are interested:

tell application "Finder"
   make new alias to file "test1.rtf" of folder "test" of folder "Applications" of startup disk
end tell

Bill






Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling VBA macro with Applescript error happyman99 Access VBA 0 October 17th, 2005 11:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.