New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

Create a executable file for mac


Post Reply New Thread Subscribe

 
Thread Tools
Capelo

 
Member Since: Apr 23, 2007
Posts: 6
Capelo is on a distinguished road

Capelo is offline
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
giulio

 
giulio's Avatar
 
Member Since: Mar 19, 2007
Location: NY USA
Posts: 1,813
giulio is just really nicegiulio is just really nicegiulio is just really nicegiulio is just really nice
Mac Specs: iMac 5.1 | iMac 7.1 | iPod Touch | iPod Nano

giulio is offline
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

schweb This has to be one of the best threads ever in MF history...
Cherokee This gets my vote for most innovative thread on Mac-Forums... ever.
QUOTE Thanks
Capelo

 
Member Since: Apr 23, 2007
Posts: 6
Capelo is on a distinguished road

Capelo is offline
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
QUOTE Thanks
giulio

 
giulio's Avatar
 
Member Since: Mar 19, 2007
Location: NY USA
Posts: 1,813
giulio is just really nicegiulio is just really nicegiulio is just really nicegiulio is just really nice
Mac Specs: iMac 5.1 | iMac 7.1 | iPod Touch | iPod Nano

giulio is offline
Well you're going to have a very hard time building a mac app without a mac!

schweb This has to be one of the best threads ever in MF history...
Cherokee This gets my vote for most innovative thread on Mac-Forums... ever.
QUOTE Thanks
Aptmunich

 
Aptmunich's Avatar
 
Member Since: Mar 09, 2004
Location: Munich
Posts: 9,075
Aptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant future
Mac Specs: Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2

Aptmunich is offline
You could also build .bat like files using Automator - however that's a Mac only application...
QUOTE Thanks
Capelo

 
Member Since: Apr 23, 2007
Posts: 6
Capelo is on a distinguished road

Capelo is offline
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
QUOTE Thanks
Brown Study

 
Brown Study's Avatar
 
Member Since: Mar 11, 2004
Location: Winnipeg
Posts: 1,964
Brown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to all
Mac Specs: G4 Tiger and OS 9

Brown Study is offline
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:
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.
QUOTE Thanks
Capelo

 
Member Since: Apr 23, 2007
Posts: 6
Capelo is on a distinguished road

Capelo is offline
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
Capelo

 
Member Since: Apr 23, 2007
Posts: 6
Capelo is on a distinguished road

Capelo is offline
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
Brown Study

 
Brown Study's Avatar
 
Member Since: Mar 11, 2004
Location: Winnipeg
Posts: 1,964
Brown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to allBrown Study is a name known to all
Mac Specs: G4 Tiger and OS 9

Brown Study is offline
Where'd you find it?
QUOTE Thanks
Capelo

 
Member Since: Apr 23, 2007
Posts: 6
Capelo is on a distinguished road

Capelo is offline
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


« Restore it from original configuration | Widget can inform, read and print the news !! »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
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 06:26 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?