Create a executable file for mac

Joined
Apr 23, 2007
Messages
6
Reaction score
1
Points
3
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
 
Joined
Mar 19, 2007
Messages
1,814
Reaction score
137
Points
63
Location
NY USA
Your Mac's Specs
iMac 5.1 | iMac 7.1 | iMac 12.1 | iMac 19.1 | iPhone 11 Pro | Watch s5
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
 
OP
C
Joined
Apr 23, 2007
Messages
6
Reaction score
1
Points
3
hello. Thanks for your reply. I have been trying to make it work like that, but it does not. The extension of the file is "*.sctp", right? Another big problem is that I don´t have a mac to test it, so I have to ask for friends to test it for me... :( But thanks for showing the way: I´ll keep on trying. :) Regards
 
Joined
Mar 19, 2007
Messages
1,814
Reaction score
137
Points
63
Location
NY USA
Your Mac's Specs
iMac 5.1 | iMac 7.1 | iMac 12.1 | iMac 19.1 | iPhone 11 Pro | Watch s5
Well you're going to have a very hard time building a mac app without a mac!
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
You could also build .bat like files using Automator - however that's a Mac only application...
 
OP
C
Joined
Apr 23, 2007
Messages
6
Reaction score
1
Points
3
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 file

Thanks for your help
 
Joined
Mar 11, 2004
Messages
1,964
Reaction score
174
Points
63
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.
If you have more specific AppleScript or application-related questions, please post them to our Bulletin Board System. This system is host to thousands of AppleScript developers who will be happy to answer any questions you may have.
 
OP
C
Joined
Apr 23, 2007
Messages
6
Reaction score
1
Points
3
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
 
OP
C
Joined
Apr 23, 2007
Messages
6
Reaction score
1
Points
3
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
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top