Drawers won't work in os 10.3.3

I am currently developing an applescript studio application (Project Builder) on my ibook runnning os 10.2.8

It is actually intended for my boss who is running os 10.3.3

My app works fine on my ibook, but when I transfer it to his MAC, the drawer won’t function.

I have had luck finding ways to get certain things to function on older version of os 10, but I can’t seen to figure this out.

Sample code:

tell window “Packaging Tracker”

tell drawer “item”

open drawer

end tell

end tell

This works fine for me in os 10.2.8, but always throws up an error on 10.3.3

I do not see this behavior in 10.3.4. I built a new project using your exact verbage and had no issues. You could have a corrupt nib file, in which case you’d probably need to rebuild your interface, either just the window/drawer…or possibly the entire nib. :cry: Just for grins, post the error you’re getting…it may provide some clues.

More likely the problem is that apple introduced a new bundle architecture in 10.3 that Project builder, distributed with 10.2.X, CAN NOT construct. Certain ASS applications and features work fine, while others do not. This may be a case where you’re out of luck. You may need to upgrade to 10.3 and then recreate your project in the new format. Xcode has the ability to open old projects and update them to the new format. Perhaps you can install xcode on your boss’ box and work over his shoulder. :lol:

Good luck…
j

Thanks, I will have to check it out again to see what the exact error message is.

But, because of our pain in the but tech-guy, i will not be able to install xcode on his machine. He is under the impression that we should not be able to control anything (and I mean anything) on our computers. that is why I am using my persomal computer to develop this tool for my boss. He won’t even let us manage our fonts ( he believes that we should only be using a handful of fonts). I mean, come on, i am a graphic designer.

I previously had a problem with running an app on an older version of osx. It was an easy fix. All I had to do was replace the “main.m” file with the “main.m” file used for that version. I was hoping this would be similar.

Sounds like your ‘tech-guy’ should be looking for another job. If you’ve got the freedom to install applications, you’ve got more destructive potential than any font or simple customization could possibly give you. Besides, customization and workflow are what macs are all about. Perhaps someone should have a talk with him about why we’re even using computers these days. Heck, you might as well go back to pencil and paper. But then again, he’d probably want to sharpen your pencils for you before every stroke. Some tech managers forget their job is to keep the computers working, and leave the actual use and configuration of those machines to the people actually USING them.

Rants and raves aside, assuming no confidentiality conflicts in your app like passwords and security issues, you may find someone (like me) willing to try to take a copy of your 10.2 version and rebuild it under 10.3, to see if that solves your problem. Feel free to email a copy to jobu10000(a)yahoo.com, or post it somewhere for download and send me a link, and I’ll take a look.

j

I will put it in a “.dmg” file.

http://webzoom.freewebs.com/raymondlewisjones/myapp.dmg

my actual site is

www.raymondlewisjones.com

for faster downloads I point to the webzoom thing.

the app functions like this:

First you can create a new project to track by clicking the “New” button under the Projects list.

You enter the name of the project, you must add an initial contact person and item.

Then you can select the project in the list.

If you select an item from the the Items list, the drawer should open with the details for the item.

This is just in rough form, and I am not claiming to be a professional scripter. So, keep the laughter to a minimum.

If you’re bored you can check out my actual site. It is basically just a portfolio of my stuff. It is also, in rough form, because I rarely get a chance to work on it.

You may have to control click and download it that way.

I only found one problem with the code that kept it from running on my box. The problem is not in the actual opening of the drawer, but is actually quite a few lines above where you’re trying to reset the values of and then close the drawer. You must execute this in a try statement so if the drawer is closed already it won’t try to force closing it again. Other than that, all of the other code seems to be working. It’s format was automatically updated to 10.3-compatible when I opened it, so there may have been some changes made that I didn’t consciously make. I’m pretty sure adding a try statement will solve it, though. Once you get a final version, if you need a rebuild for 10.3 just send me another copy and I’ll build it again and send it back.

Just some design notes…
You might want to open the drawer AFTER setting the values in the fields and the picture. It makes the opening transition go a lot smoother.

You should consider using some other, less common delimiter for your databases. A common delim for flat-file databases is the pipe " | " symbol. It’s rarely used and most likely won’t get entered by a user as part of everyday typing. A comma could easily get entered and would screw up your entire database file structure.

You also should get in the habit of setting applescript’s text item delimiters back to the values they were at before you changed them. This will help you avoid any conflicts later down the code. Applescript uses it’s delim’s to create lists and make strings from lists, so if they’re set wrong, you may end up with unpleasant and difficult to troubleshoot problems.

To reduce the risk of memory pile-up, I prefer to set my permanent images as variables on launch, and then to release any images I load during use as they are no longer needed. See sample below.

Here’s the updated problematic code…

				try --> Add this!!
					tell drawer "item"
						
						set the contents of text field "template" to ""
						set the contents of text field "sku" to ""
						set the contents of text field "engraving" to ""
						set the contents of text field "producingplant" to ""
						set the contents of text field "vendor" to ""
						
						set the image of image view "preview" to load image "no image"
						
						close drawer
						
					end tell
				end try [b]--> Add this, too!

Sample of resetting the delimiters…

set DelimOld to applescript's text item delimiters --> Save the old delim
set applescript's text item delimiters to "|"
--> Do something
set applescript's text item delimiters to DelimOld --> Revert to the old delim

Pre-loading and Releasing images

(* Preload an image, *)
property NoImage : missing value
on launched theObject
	set NoImage to load image "NoImage"
end launched
--> Usage --> set image of image view "imageView" of window "mainWindow" to NoImage

(* Set new image and release old *)
try
	set oldImage to image of image view "imageView" of window "mainWindow"
end try
set image of image view "imageView" of window "mainWindow" to load image "newImage"
try
	delete oldImage
end try

Keep it going. Your work is functional and practical…as it should be. Nice job on the icon, too. Let me know if there are any more troubles.

j

Well, thanks fot the input. I will try putting it in “try” statements.

I also, had always wanted to set the delimiters back to the old value, but didn’t know how or even what they used to be. Thanks for the info.

hey jobu,

Thanks for all your help with this.

I put the close drawer command inside a try statement and it seems to work perfectly. I always forget about the try statement. I’ve used it alot on regular Applescript projects, but I seemed to forget all about it in Applescript Studio.

Well, If you have any questions or need any help with anything you are ever working on, let me know. I would be glad to give my input.

:smiley: