Progress Indicator for “Plain” Scripts.

That is correct.

Almost. You have an extra* parentheses, so it won’t compile (you should do that before you post stuff). Also, the POSIX path of a folder will have a / on the end; You don’t need one in you’re last piece of text (at the begining, though there should be one on the end) . Finally, you should probably use Unicode text instead.

One of these should work, depending on what you want to do with the value.

-- Unicode text
(path to me as Unicode text) & "Contents:Resources:"

-- Alias
alias ((path to me as Unicode text) & "Contents:Resources:")

-- POSIX path (Unicode text)
POSIX path of (path to me as Unicode text) & "Contents/Resources/"

  • I hope it’s an extra parentheses. If you included one on the end, you would get a different result (the slashes in the last piece of text would be turned into colons).
POSIX path of ((path to me as Unicode text) & "Contents/Resources/")
--> "/Applications/AppleScript/Script Editor.app/Contents:Resources:"

Yep. You’re right. I tested it and forgot to correct the parenthesis when I fixed it in Script Debugger.

But after I fixed it, I did not notice that the “POSIX path of” would generate colons where slashes are. I got no syntax error. After some thought, I understand why this is - it is so that you can have colons in your POSIX path or vice versa.

Also, thanks for pointing out that “POSIX path of (path to me)” includes the trailing slash (as does “path to resource” if the script is an app bundle), because “path to me” ends in a colon. Another goof on my part.

I corrected my previous post.

My template worked because I used “path to resource”, so I just had to code


set Progress to load script (path to resource "Progress.scpt")

And that works (in Tiger) for getting the path to the icns files too.

I have noticed that when I add files to the resources of a script, it disappears when I do a Save As from Script Editor. Saving updates doesn’t cause a problem but using Save As to create a new file seems to lose the added files. Has this changed in Tiger? Have you tested your template/SaveAs approach without problems?

I added an icns file to an existing template, opened the template, and saved as a new file, and the icns file appeared in the new file.

What type of resource is it that is not getting saved to the new file?

It happens in a script I made to install a custom Acrobat Distiller setting. The setting is in the resources folder in the scripts package. If I open the script in Script Editor and save as to a new file, the acrobat setting is not in the resources folder of the new file.

It sound like you are not having that problem so maybe something has changed in the newer Tiger version.

Model: Mac G5 OS 10.3.9
Browser: Safari 312.3.1
Operating System: Mac OS X (10.3.9)

Here are the Tiger release notes, although I do not see anything in them that specifically addresses bundled resources and Script Editor.

Maybe Script Editor somehow wants the resource to be listed in the info.plist file?

http://developer.apple.com/releasenotes/AppleScript/AppleScript.html#X10_4

Thanks much for the effort you have put into this project:cool:

How would you dynamically set the progress indicator to display and increase for variing process times?
I batch multiple files that can take any where from a minute to five minutes to process

Browser: Safari 419.3
Operating System: Mac OS X (10.4)

I build it into the script. If I had 10 files to process, I’d advance the PI 10% in each iteration of the loop doing the processing and change the message to indicate which file was being processed on the indicator. See my example in Code Exchange

Bruce,

Thanks for providing us with your progress-dialog stuff. Any chance of getting a universal binary edition of Progress.app?

Thanks!
mcbird