Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've got some old .as files from a project I was working on on a different mac a long time ago. I was trying to open one of them just to try and remember something. But for some reason my mac thinks they're zip files (even though I've used these same files on another mac before).

If I double click one of the .as files, Archive Utility opens, thinks for a second, then disappears and nothing happens. If I right click -> open with Text Edit, it opens and displays the correct file, but I don't want to use Text Edit. I want to view the file in XCode. When I right click -> open with XCode, it doesn't display the code in the file; it shows a little zip image with AS on it, and no text.

picture of AS icon

I just noticed it's showing the file type as "AppleSingle archive". The only thing I can think is that that could be abbreviated ".as" too. But why would it have worked on another computer (and presumably many other people's computers) and what can I do to fix it?

enter image description here

share|improve this question
    
I wonder what the terminal file command makes of one of the ActionScript documents. It sounds like an Xcode bug from BoltClock's answer, but perhaps the confusion is more deep than just the file extension. –  bmike Apr 21 at 20:14
    
@bmike: "Java program text" ಠ_ಠ But at least it recognizes it as text and not binary... –  BoltClock Apr 22 at 3:51
    
@bmike Interesting! I've got 2 new pieces of information from this: 1) the output from the file command is UTF-8 Unicode (with BOM) C++ program text, with CR line terminators. 2) When I ls the directory the file is in, it shows FileName.as, as I would expect, but also FileName.as.cpgz and FileName.as 2.cpgz (yes that space is accurate), and these files do not show up in the finder. Strange! These other files only show up for the .as file I've tried to open, not the other .as files in the directory. –  WendiKidd Apr 22 at 14:14

2 Answers 2

up vote 3 down vote accepted

Xcode doesn't support ActionScript files out of the box, so it sees your file and thinks it's an AppleSingle file instead, as does the rest of your Mac, since that's how OS X usually understands files with the .as extension by default.

Unfortunately I couldn't find any information on getting Xcode to support ActionScript projects. There is this Stack Overflow question, but it (and the resources the answers point to) doesn't give you much to go on, and I can't really vouch for any of the answers either since I don't do AS development on my Mac.

TextEdit should open your script in plaintext mode with no issues, though. If you just want to give it a quick read, you might just have to go with TextEdit for now until you can acquire Flash or another IDE.

The reason why it used to work on your old Mac, presumably, is because you had Flash or a different IDE that designated .as files as ActionScript files, overriding the system default of AppleSingle file. Based on this, installing Flash should be enough to get your Mac to recognize .as files as ActionScript files.

share|improve this answer

And, while not trying to be pedantic (HAH!) you can change the default application these are being opened with easily enough.

  • Get info on one of the .as files
  • Under the Open With: section of the get info window select the application you want it to open with.
  • The Change All button should then be available so you can change all .as files to open with the app of choice.
share|improve this answer
1  
Yeah, but doing this doesn't help because XCode won't open the file properly. Unfortunately it shows an image of the icon, not the text. –  WendiKidd Apr 21 at 19:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.