Script Editor will not record.

Does anyone know why my AppleScript will not record? I have tried recording making new folders, emptying the trash, and opening Safari. It doesn’t record anything. I am using version 1.9.

Thanks,
Connie

Model: iMac
AppleScript: 1.9
Browser: Safari 85.8.1
Operating System: Mac OS X (10.2.x)

Connie:

Could you please be a little more specific about what you mean by ‘record?’ Better yet, if you could please post some code that you have had difficulties with, there are plenty of gifted scripters that can help out.

It isn’t a script.

When you open Script Editor, there are three buttons in the middle of the editor. They are Record, Stop, Run and then Check Syntax. I thought when you pressed Record, Script Editor would record things you do on your computer as long as they are scriptable programs. Things like emptying the trash, making a new folder, opening Safari. I have seen this work on an OS 9 machine.

Mine doesn’t record anything. I saw on an archived discussion at Apple that someone else had the same problem, but the only solution posted was that someone had seen a helper application or something that fixed it. They didn’t post the name of the app. or a link or anything. I have tried searching the internet, but I can’t find it.

http://discussions.apple.com/thread.jspa?messageID=1156737&#1156737

I hope this makes sense now.

I guess it doesn’t record very much. I left it open and started doing different kinds of things and it recorded opening AppleWorks and quitting AppleWorks.

I used it in OS 9 to learn some basic AppleScript. It recorded making new folders, opening IE, and emptying the trash. I thought it would do the same thing in OS X.

Applications have to support recording.

See also: How can I tell if a particular application is recordable?

I just thought regular things like making new folders and emptying the trash would be recorded. Sorry.

I wouldn’t call those regular things. Those are things that are (typically) done by the Finder. Speaking of which, did you notice this part?

“Some recordable applications are: . the Finder (OS X v10.0 thru 10.2 aren’t recordable, but v10.3 [Panther] is!).”

On your version of OS X, the Finder doesn’t support recording.

In this context, it’s perhaps worth regarding Mac OS X as still something of a work in progress, Connie.

By contrast, OS 9 was a mature product developed over many years, with a history of eight previous full integer revisions under its belt. The ability to capture certain key actions in an application and record them in a script was quite well advanced there - and a number of major applications supported the recording of scripts in Applescript.

In terms of their AppleScript implementation, Mac applications can be broadly categorised as offering:

¢ No scriptability (and therefore no recordability)
¢ Limited scriptability (and therefore no recordability)
¢ Comprehensive scriptability (possibly with recordability)

Obviously, before an application can offer recordability, its AppleScript implementation needs to be pretty substantial. So developers who intend to support AS will invest more time and effort getting that right, first.

When Mac OS X was first launched, Apple (along with various third-party Mac software developers) were, to an extent, going back to the drawing board. Most current Apple applications were introduced with (or since) OS X - including TextEdit, Safari, Mail, Address Book, iCal, iTunes, iPhoto, iMovie, etc.

In my opinion (for what it’s worth), several of these products still have some way to go before their AS implementation could be considered fully “up to scratch”. So at the moment, I’d rather see programmers concentrating their efforts on achieving this aim, rather than skimming over the basics in order to bolt on some of the bells and whistles.

Please don’t get me wrong. I’d love to see more features like recording introduced (even though I’d probably not really use them myself). They’re a great way to encourage new users and provide initial assistance to those interested in getting into scripting. I’m just suggesting that there would be little point in doing so if the underlying foundation is incomplete and/or fragile.

I don’t personally know of any utility that might enhance AS recording - but then, I haven’t really been looking for one. If you want to try out a product with excellent AppleScript implementation and recordability, then you should try something like Tex-Edit Plus. Things appear to moving in the right direction in the Apple camp, too. For example, recording is now possible in Finder - but I’m afraid you’ll have to consider upgrading to take advantage of it. To demonstrate this, I just recorded my actions while creating and renaming a new folder. Here’s the result:

tell application "Finder"
	activate
	select window of desktop
	make new folder at folder "Documents" of folder "kai" of folder "Users" of startup disk with properties {name:"untitled folder"}
	set name of folder "untitled folder" of folder "Documents" of folder "kai" of folder "Users" of startup disk to "my new folder"
end tell

OK, it may not be exactly what I’d write, but it’s pretty good - and it works. :slight_smile:

What’s that? What would I have written? Oh, something quite close - but perhaps adjusted slightly so that it might also work on another machine:

tell application "Finder" to make new folder at (path to documents folder) with properties {name:"my new folder"}

(Is that tempting fate? Surely someone’s bound to tell me now that it doesn’t work on their machine…) :wink:

Thanks for the information. It is hard to work with AppleScript when you don’t know a lot about it (like almost nil) and there are so many different versions.

I use Macs at work. I work at two Jr. Highs. I know that the OS I am running is old, but I can’t update it any further than 10.2.8. 10.2.8 is stretching it too. My principals expect me to perform miracles with them because I have played with AppleScript a little and made the computers do some helpful things.

I can search the internet and find about 4 ways to tell the computer to do something in AppleScript and not one of those ways works. Which just makes it a bigger puzzle.

I hate having to come here and ask for help all the time. I try to exhaust all kinds of searches before I ever do. I don’t want you to feel like I never do any of it myself and just ask here to get my answers. It feels so much better to search and find the answers. At least I feel like I have tried.

I greatly appreciate all the help with the last script I needed. I thought I had that script done, but I was proved wrong when using it.

That is why I wanted to use the recorder. I thought that it would at least show me how to unmute the sound. Just telling it to turn up the volume doesn’t unmute it. It turns the sound up though. I searched and found lots of ways to unmute the sound. Just none of them would pass the Check Syntax part.

I will probably end up asking before the weekend actually gets here.

Thanks for helping me and answering my posts =)

Connie

Connie:

Sorry that I did not understand your issue initially; I have never even tried using the Record option myself. At any rate, the air is clearer now and I would like to clear it a bit more.

I suppose that morally you have a point, but in reality, this is precisely why this forum exists. As long as you are polite and grateful, you can come here and ask as many questions as you like, and you will get extremely helpful answers. Don’t be shy about it; post as often as you like.

There is also a free download PDF for beginning Applescript, as well as our galaxy famous Links page and Books Page. The truth is, by searching this BBS and investigating these other resources, you can focus your time more effectively, then make a new post to either help clear up something or add onto something you’ve discovered that needs a little help.

I certainly hope so; you will be helping a lot of other people do something interesting to impress your principal.

Good luck,

Connie, I’m sure that I speak for most, if not all, folks around here - when I say that your questions are warmly welcomed.

After all, that’s what (I believe) this site is all about. Some come here looking for answers, others to share the knowledge they’ve been fortunate enough to learn from someone else, previously. It’s actually a very friendly place, with some great characters and keen minds. Some might have swanky, gleaming new machines with all the latest, whizzy, state-of-the-art features, while others may have to make do with something a little more… sedate. Some might make their living, or part of it, from their encyclopaedic computer knowledge, and others just get a buzz from producing a small script to perform the most modest of actions. There are those who seem to have all the facts at their fingertips, while others may just use their fingertips to fumble around in the dark.

But actually, none of that really matters.

At the end of the day, we’re here to help each other. We all bring something to the place and, hopefully, we all leave again later having gained something. We come in all flavours of humanity, and are the richer for it. While there may be the occasional misunderstanding, that’s all it usually is - and I’d be very surprised if anyone ever intentionally tried to upset or put down another.

Incidentally, I used Mac OS 10.2.8 myself for a long time, before I was eventually persuaded to change. Happy days. Typically, apart from the the most trumpeted features of the current OS, I now find it hard to remember the minutiae of the differences. (Time seems to have this curious blurring effect.) So I’m afraid we may all too often make suggestions that don’t work for you. Please bear with us on this. It can be frustrating from either point of view, but we’ll try…

The “potential” question to which you referred (about unmuting sound) may be a case in point. On my machine, Standard Additions’ miscellaneous suite offers the following, which works for me:

set volume without output muted

(Aside: Just tested that with Eva Cassidy singing “Danny Boy”. Just wiped away a tiny tear. Just call me a big softy.)

Hrmm… I digress.

The thing is, I had a feeling the above command was introduced relatively recently. Turns out it appeared with Standard Additions 1.9.4 (Mac OS X 10.3.5) - so no dice there, I’m afraid. It would be necessary to explore the AS dictionary on your system to see if there’s anything else in there that might do the trick. I also considered a UI scripting possibility - until I remembered that UI scripting was available only as Beta software on Mac OS 10.2.8. As far as I know, that software is no longer available officially (unless your machine just happens to have had it installed). Otherwise, might be tricky… :confused:

Anyway, I’d just like to echo Craig’s sentiments on all this. If you have a question, ask away. Hell, what have you got to lose?

Someone here will usually attempt an answer. If anybody else thinks of an alternative, they’ll probably chip in, too. The suggestions may not work. So come back again and, if we can, we’ll try something else. If you get no reply, it’s not because nobody loves you - it might just be that the answer eludes us. Sometimes there just won’t be a solution. (My dear ol’ Mum, bless her, warned me there’d be days like that - and she was right.)

Take care. :slight_smile:

You all have been very nice and very helpful. I like coming here. Just sometimes it is nice to figure things out on your own and when you can’t do it very often, it is frustrating.

I am glad I got the last script to work. I am a computer tech at two schools. I divide my week between the two. One of them has kids that are from a much lower class and mice seem to disappear a lot. One of my principals asked me if I could figure out a way for the computer to alert that a mouse was unplugged. I started playing around with AppleScript and showed him a script that made the computers shut down with one click and some other scripts I got to work about half way. He obviously thinks I know more about AppleScript than I really do LOL. Funny the trouble playing around on a Mac gets you into. I also do the webpage for them and they seem to think that I can do way more than I am capable of.

So, I decide to give this mouse thing a try. You guys were AWESOME with all the help you gave me. The script did everything I wanted it to do. Then I found out if the computer was muted that the script only turns up the volume and not unmute it. So, now I have another problem to see if I can get it fixed.

I will post a new topic and see if I can get it answered.

Thanks again for being so nice and posting replies to me =)