How do you open a file with AppleScript?

Hi,

I’m new to AppleScript, and I’m just wondering if it’s possible to open a macintosh flash projector file with AppleScript?
I want to make a AppleScript file (I don’t really know if this is how you do it, creating a script file?) which will by clicking on it, open the macintosh flash projector file, which is placed in a diffrent folder.

I’m not sure if it’s possible and how it works.
Would really appreciate any help I can get.

This is my first post, so please be gentle :wink:

Cheers*
Marcus

Marcus:

All things are possible with AppleScript (AS). Here is a link to a free download ebook that is a quick read and can help you get started: Applescript for Absolute Starters.

I am unsure what type of file you are talking about (I have no experience with anything related to macintosh flash projector), but if you can supply a few more details, someone is likely to have some specific information you can use.

Good luck,

Marcus, is there any reason why you couldn’t use an alias?

That said, if we’re thinking about the same thing, then a Flash Projector is just a flash file saved as an executable file. Thus, something like this (saved as an application) should work:

activate application "Your Projector's Name"

Huh?

You mean why I used Marcus when my screen name is BagOfFun?

Yes, the flash projector is an executable file.
I’m working on a PC with flash and I’ve created a flash projector of my project (a .hxq file),
but don’t worry about that, I got the whole mac compiling thing coverd.
I’m using MacImage to “convert” the flash mac projector (.hxq), so it works on mac.
And I’m also using MacImage to burn a hybrid cd on my pc, so it works on booth platforms.

Are you with me?

Thanks for the tip Bruce; activate application “Your Projector’s Name”
I’m just wondering now how you do “activate”/open the application/my projector if it’s in a diffrent folder?
And do you create a “AppleScript file” with this script within it, or how does it work?

I’m on a PC but I’m gonna ask a friend with a Mac to do this for me,
or is it possible to do AppleScript on a PC?

The tell application term doesn’t care where the program is.

Tell application "MyProjector" to activate

tells the mac that if there is a program named “MyProjector”, then open it

to open a specific file or app, use the finder:

Tell application "Finder" to open "MyHD:MyFolder:MyProjector"

PS: an “alias” is the macintosh term for a shortcut (link) to a file

Aah, see now you made me look like a complete goof* :slight_smile:

ok, so it’s a good idea to use;

Tell application "MyProjector" to activate

but if I’m to use the other one where you tell the finder to located it;

Tell application "Finder" to open "MyHD:MyFolder:MyProjector"

My whole project will be on a CD. So is there a standard “name” for the CD drive on Mac,
or is it like on a PC where you don’t know if the user has the CD drive on E:, D:, F: or even M;?

Is it safest to go with the first one where you don’t give a specific location?

If you need/want to specify a path to an application, you can do this (no need to use Finder):

activate application "MyHD:MyFolder:MyProjector"

See also: References to Applications

Also, as pilothigh said, an “alias” is the same thing as a “shortcut” in Windows.

Ah, now I see.
My mind never ran in that direction, - creating a “alias”/shortcut.
So you think it’s the best way to go?

But still, if I wanted to go the AppleScript way.
How do i direct the script so MyHD = the CD drive?

I really appreciate your help guys* :slight_smile:

Change “MyHD” to the name of the CD. (Mac/Unix doesn’t use drive letters.)