Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-27-2010, 08:08 PM   #1
yoshyaro
Member
 
Join Date: Mar 2010
Posts: 51
Default File paths question

I'm launching a couple of different things using fscommand and a .bat file, which has the full path of what I'm launching (c:\\windows\etc...). since this will be on a CD, going into different computers, how to you set up the paths correctly so it still points to your file?
yoshyaro is offline   Reply With Quote
Old 03-28-2010, 05:48 AM   #2
northcode
Senior Member
 
northcode's Avatar
 
Join Date: Apr 2002
Location: Ottawa, Ontario, Canada
Posts: 419
Default

Type set at a DOS prompt and hit return to see a list of environment variables that you can use. There should a list in the format VARNAME=value. Anything that appears on the left side of the = sign can be used in your BAT files.

For example, if you wanted to open the Windows folder is on any machine you could use the windir environment variable like this in a BAT file.

Code:
explorer %windir%
Any environment variable can be used with % signs around it in a BAT file and Windows will take care of expanding it to the full value at runtime.

NOTE: Check with Windows help to make sure the environment variable you want to use is a standard one created by Windows and not by an application you might have installed because anyone can register new environment variables.

I hope that helps
__________________
When your swf2exe tool just HAS to work
there's only one choice... SWF Studio
northcode is offline   Reply With Quote
Old 03-29-2010, 01:49 AM   #3
yoshyaro
Member
 
Join Date: Mar 2010
Posts: 51
Default

cool. Thanks.

Last edited by yoshyaro; 03-29-2010 at 02:26 AM. Reason: Searching made question redundant
yoshyaro is offline   Reply With Quote
Old 03-29-2010, 02:49 AM   #4
yoshyaro
Member
 
Join Date: Mar 2010
Posts: 51
Default

Alright.. I don't seem to get it. I checked the set list in dos, and looked up the environment list online, but I don't see one for a CD drive.

Thinking into this further... since all my bat files are doing is launching PDFs in the fscommand folder, do I need to know the CD drive letter? Or is there something equivalent to actionscript's "this." command. The pdfs are in the same folder as the .bats.

CD drive > fscommand > files and .bats
yoshyaro is offline   Reply With Quote
Old 03-29-2010, 01:16 PM   #5
yoshyaro
Member
 
Join Date: Mar 2010
Posts: 51
Default

Aha! http://www.allenware.com/icsw/icswref.htm Dot aliasing is just what I was looking for. It references the local folder without having to know it's drive letter.
yoshyaro is offline   Reply With Quote
Old 03-29-2010, 01:51 PM   #6
northcode
Senior Member
 
northcode's Avatar
 
Join Date: Apr 2002
Location: Ottawa, Ontario, Canada
Posts: 419
Default

If you're running from a CD you can reference any folder on the CD using an absolute path without the drive letter like \fscommand\file.odf so you don't need to use the "." or ".." relative paths (if that makes things a little easier).
__________________
When your swf2exe tool just HAS to work
there's only one choice... SWF Studio
northcode is offline   Reply With Quote
Old 03-29-2010, 03:14 PM   #7
yoshyaro
Member
 
Join Date: Mar 2010
Posts: 51
Default

Indeed. Thanks again!

...You wouldn't happen to know how to do the same thing with apple scripts by any chance? ..Opening windows and pdfs?

Last edited by yoshyaro; 03-29-2010 at 03:23 PM.
yoshyaro is offline   Reply With Quote
Old 03-29-2010, 06:42 PM   #8
northcode
Senior Member
 
northcode's Avatar
 
Join Date: Apr 2002
Location: Ottawa, Ontario, Canada
Posts: 419
Default

Give this a whirl...
Code:
tell application "Finder"
   activate
   select file "file.pdf" of folder "MyPDFFiles" of disk "MyCD"
   open selection
end tell
__________________
When your swf2exe tool just HAS to work
there's only one choice... SWF Studio
northcode is offline   Reply With Quote
Old 03-29-2010, 06:58 PM   #9
yoshyaro
Member
 
Join Date: Mar 2010
Posts: 51
Default

Excellent! Thank you. I'll check this out tonight on my woman's mac.
yoshyaro is offline   Reply With Quote
Old 03-30-2010, 07:46 PM   #10
yoshyaro
Member
 
Join Date: Mar 2010
Posts: 51
Default

Alright, I've gotten this to work while all of my files are in a folder, so I write:

Quote:
select folder "myFolder" in folder "my other folder"
open selection
but I've kind of run into the same problem as before. I'm not sure how to target the CD drive, or keep the search within the same folder.

I've tried just writing:
Quote:
select folder "myFolder'
open selection
And sticking that script in the same folder as the folder I want to launch, but it returns an error (Can't remember which one, I'm back on a PC now).

I guess the way around my problem, is to name the CD something specific, and then modify the apple script any time I change the CD name. This way I can add "of disk "myCD" to the end of the script?

It's tricky to do this having only periodic access to a mac..

Last edited by yoshyaro; 03-30-2010 at 07:59 PM.
yoshyaro is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT. The time now is 03:12 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.