Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

AppleScript error on Tiger only: "can't make file into type alias"

Hi,


I'm successfully using this smart TextWrangler applescript from this webpage for opening files on the same folder as the current document:

http://blog.ampli.fi/textwrangler-open-file-from-directory-of-current-file/


It works fine on Mountain Lion.


However, when I try it on Tiger 10.4.11, this error dialog appears: "TextWrangler got an error: Can't make [file] into type alias".


The script basically gets the path of the current document in TextWrangler and posts a file chooser on such path.


I guess these are the lines that Tiger doesn't like:



setcurrent_pathtoPOSIX pathofcurrent_file


setnew_filetochoose filedefault location (current_path) withmultiple selections allowed

opennew_file


After googling for the error "can't make [] into type alias", I tried to change such lines to:



setcurrent_pathto (POSIX pathof (current_file as alias))


setnew_filetochoose filedefault location (current_path) withmultiple selections allowed

opennew_file


But, however, the same error remains.


Do you have any idea on how could this work?


Thanks!

iMac, Mac OS X (10.4.11)

Posted on Oct 22, 2012 7:36 AM

Reply
Question marked as Best reply

Posted on Oct 22, 2012 7:46 AM

wow, 10.4...


try this:


set current_path to current_file

set new_file to choose filedefault location (current_path) with multiple selections allowed

opennew_file


I'm not certain when the standard applescript dialogs were updated to accept posix paths, but it may have been 10.5.

2 replies

AppleScript error on Tiger only: "can't make file into type alias"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.