As far as I know there's no way to compile an AppleScript from a PC, you'll need a Mac to do that.
If you know where the file is going to be on the CD and you can set the CD name then you can use a simple script like this one.
If you can't control any of that, then you have to resort to something a little more complicated that locates the file you want to open from a location relative to your application. I've posted this before, but I'll save you the trouble of hunting it down.Code:tell application "Finder" activate select file "file.doc" of folder "fscommand" of disk "CDNAME" open selection end tell
If you're using CS3 (or newer) you need to know that the FSCommand folder is now INSIDE your .app file and not an external folder as it was in versions before that. This makes targeting files from AppleScript a little trickier because every reference you make is relative to the fscommand folder, where the AppliScript has to be so you can EXEC it.Code:--set the name of the file to open property fileName : "homepage.html" --get the path to the containing folder set myPath to (path to me as string) set AppleScript's text item delimiters to ":" set the parentFolder to ¬ ((text items 1 thru -2 of myPath) & "") as string set AppleScript's text item delimiters to "" -- find the flash file try set targetFile to alias (the parentFolder & fileName) on error --ie if there's no file here by this name, it will quit. return quit end try -- open the file tell application "Finder" open file targetFile end tell




Reply With Quote