| OS X - Apps and Games Discussion of applications and games available for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Apr 23, 2007
Posts: 6
![]() |
Hello there. (First time here) :mac:
So, I am doing this flash application for both pc and Mac. I have functions to open some *.pdf and *.html files. So, for pc, I execute a *.bat file wich will open the pdf oh html file I want. Well, this is very simple, because I can create the *.bat file in any text editor, just saying something like "start myfile.pdf" and record it with the "bat" extension. Is there any similar file for mac? How can I run a system file to make start another? Thanks in advance. P. Capelo |
| QUOTE Thanks | |
![]() Member Since: Mar 19, 2007
Location: NY USA
Posts: 1,813
![]() ![]() ![]() ![]() Mac Specs: iMac 5.1 | iMac 7.1 | iPod Touch | iPod Nano
|
You will need applescript for that that. The editor is in the Applications > Utlitites
I'm not sure of the syntax... but I think it would be something like: Tell Application Finder.app open file.ext end tell |
| QUOTE Thanks | |
![]() Member Since: Apr 23, 2007
Posts: 6
![]() |
But thanks for showing the way: I´ll keep on trying. Regards
|
||||
| QUOTE Thanks | |||||
![]() Member Since: Mar 19, 2007
Location: NY USA
Posts: 1,813
![]() ![]() ![]() ![]() Mac Specs: iMac 5.1 | iMac 7.1 | iPod Touch | iPod Nano
|
|
| QUOTE Thanks | |
![]() Member Since: Mar 09, 2004
Location: Munich
Posts: 9,075
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
|
|
| QUOTE Thanks | |
![]() Member Since: Apr 23, 2007
Posts: 6
![]() |
well, I got it.
Now, I have a mac, and things are working. Just one thing: I need to tell application Finder to open a file wich is not on desktop, so it wont work. The problem is that the files shall be at the cd-rom, so I can´t no the absolute path. Is there any way to refer the folder where the script file is? It can´t be the front window, because the window will not be opened. The script will be called from an executable flash fileThanks for your help |
| QUOTE Thanks | |
![]() Member Since: Mar 11, 2004
Location: Winnipeg
Posts: 1,964
![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: G4 — Tiger and OS 9
|
Check out macscripter.net. It has a wealth of information for the neophyte and veteran scripter alike, and the forum posters appear to be very helpful.
Quote:
|
|
| QUOTE Thanks | ||
![]() Member Since: Apr 23, 2007
Posts: 6
![]() |
well, it seems I can´t register in macscripter...
![]() so, can anyone tell me why isn´t this working? I want to open the pdf file wich is in the same folder as the script executable file... set scriptFile to the path to me set folderName to the folder of the scriptFile tell application "Finder" open file "link_a_7_2_1.pdf" of folder folderName end tell |
| QUOTE Thanks | |
![]() Member Since: Apr 23, 2007
Posts: 6
![]() |
well, just got it.
so, for someone who search this later, to open a file in the same folder as the script file, do this:--change this variable set theFile to "your_file.pdf" ------------------------------ set myPath to path to me tell application "Finder" set myFolder to (container of myPath) as string open file theFile of folder myFolder end tell |
| QUOTE Thanks | |
![]() Member Since: Mar 11, 2004
Location: Winnipeg
Posts: 1,964
![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: G4 — Tiger and OS 9
|
|
| QUOTE Thanks | |
![]() Member Since: Apr 23, 2007
Posts: 6
![]() |
well, the part to find the folder path was in a macscripter forum (http://bbs.applescript.net/viewtopic...55&action=new). I got there by google; and the rest, also google and trying diferent ways...
By the way, I must say thanks to all the answers before that helped to get this solution. Regards P. Capelo |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| How do I create a simple text file? | tenover | Switcher Hangout | 2 | 04-17-2007 02:04 PM |
| Unix Executable File problem | fender1100 | OS X - Apps and Games | 9 | 01-07-2007 06:20 AM |
| Not too pleased with new iMac | JunMacTech | Apple Desktops | 14 | 12-05-2005 07:13 PM |
| Can you guys open this site? | Desolate One | OS X - Apps and Games | 13 | 04-29-2005 01:23 PM |
All times are GMT -4. The time now is 02:38 AM.
Powered by vBulletin