set the current working path in tiger

Hi,
I am using the following code in Leopard
tell application “Finder”
set myPath to (path to me)
set myFolder to folder of myPath as text
end tell
then it gives the path of that folder from where i am running this script
but when i am running this in Tiger then it gives the path of tiger:Applications:AppleScripts not the path from where i am running the script. how i can fix this problem in tiger i want the path of that folder where the scripts are saved.
thanks
Amit patel
email- amitpatel.nitk@gmail.com

You’re sure you saved the script as an application and didn’t run it in Script Editor?

Hi,

Actually I saved this scripts as a script editor not an application. But the same thing is working in Leopard but not in the Tiger. Actually when i will save it as an application then i can’t see the scripts code but i want that i could open the script and click on the Run button.

Thanks
Amit

I don’t know if it’s possible, it could be, maybe someone else knows. I don’t use Script Editor very often, I’m using AppleScript Studio instead.

Hi,

it’s a feature. Path to me works different in Tiger and Leopard.

It both system versions it returns the path to the script itself, when the script runs as application.

In Tiger it returns the path to Script Editor.app, when the script runs in Script Editor
In Leopard it returns the path to the script itself, when the script runs in Script Editor

Script Debugger works always as Leopard does

Hi,

So how can i get the path of scripts where it saved?. Actually i want the Path of current working Folder in Tiger where i am saving the scripts. Is there any other option of “Path to me” in tiger. Give me the solution in details with examples because i am using applescripts first time in Tiger so i don’t have to much idea for tiger.

Thanks
Amit

maybe you can tweak this…

tell application "Finder"
	set my_folder_path to container of (path to me) as text
	display dialog my_folder_path
end tell

and your script works for me on Tiger.

tell application "Finder"
	set myPath to (path to me)
	set myFolder to folder of myPath as text
	display dialog myFolder
end tell

Tom