Identify the Script's Own Folder & How to Restart Airport

Edit: Search is your friend. A LOT of threads about Airport so will read all of these and repost my second question another time as necessary. A typical n00b mistake sorry. Unable to edit title sorry.

  1. I’m writing a script to function as a kind of database to manage manipulation and archiving of files off a USB flash memory reader.

A problem I have is how to identify the pathname of the folder within which the script resides. The intention is that this will be the default or first folder to check for associated files.

Yes, the script should probably reside in the Applications folder and I should ask the user for the location of the data folder BUT I’m dealing with my very young children who will be running the script and navigating the folder lookup dialog is beyond at least one. They aren’t interested in where the files actually reside, just running the script and selecting a few options because daddy is too busy at work or whatever to come home and help!

Any help much appreciated.

(I am unable to upgrade to Leopard as pro app compliance is still some time away for Leopard :frowning: )

Model: iMac 2006 with OSX 10.4.11
AppleScript: 1.10.7
Browser: Safari 525.13
Operating System: Mac OS X (10.4)

Save this as an application somewhere and give it a run :slight_smile:

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

Thanks but only gives a result pointing to my Applications folder.

The script will actually reside in a folder on the desktop or somewhere else. I need to identify the location. It won’t necessarily be the Applications folder. Thanks

Edit: Well, well, well! I am totally wrong. I had to save as an Application Bundle. When run as one of these then presto!

As a script then of course it points to the Script Editor!

Many thanks!

Sorry I wasn’t totally clear about the saving as an application bundle… glad it works for you!

Not of course, only if you run the script form Script Editor.
If you run it from the script menu, it refers to itself.

Note: Script Debugger handles path to me correctly