A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: File separator character?

  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    Vienna, VA USA
    Posts
    116

    File separator character?

    Is it the \ or the / character that separates directories in Windows references?

    I've been writing batch files (for use with Proxy) as
    Code:
    start pdf/1a.pdf
    which seems to work but maybe I'm supposed to use the \ instead (?).

    Phyllis

  2. #2
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    If you're writing BAT files use \, the / character is used for specifying options on command lines. Flash will normally accept either one when used in Flash commands like getURL because / is used in URLs so it just does the conversion. However, in third party products (like SWF Studio) you'll probably want to use \ (or "\\" when used in a string literal) when you refer to operating system paths to avoid any possible problems.

  3. #3
    Senior Member
    Join Date
    May 2003
    Location
    Vienna, VA USA
    Posts
    116
    Okay thanks, I'll change them all on the next CD. Though the slash seems to work for the most part (I didn't find any machines where it didn't work). But I'd rather it be right!

  4. #4
    Senior Member
    Join Date
    May 2003
    Location
    Vienna, VA USA
    Posts
    116
    What's the file separator for Mac, do you know? I think I read once that it was a colon, but I also heard slash, so dunno. Wondering if this is correct (may be a while before I can do a test & I don't understand most of this script):

    Code:
    --set the name of the file to open 
    property fileName : "pdf:1a.pdf"
    
    --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
    tell application "Finder"
    	open file targetFile
    end tell
    Thanks, Phyllis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center