Thursday, February 23, 2017

#1 2006-08-27 04:11:50 am

Kevin Bradley
Administrator
From: Independence, MO
Registered: 2006-03-13
Posts: 548
Website

AppleScript 1.10 (Tiger 10.4)

Standard Additions Fixes

User Interaction
The choose application, choose from list, choose URL, and display dialog commands will no longer present dialogs on remote machines.

The choose application command no longer leaks memory.

In Mac OS X version 10.3.x, the choose application dialog is not responsive to mouse clicks within the content area when inactive. This has been fixed.

The of type parameter to the choose file command now works correctly for packages that don’t contain a PkgInfo file (e.g., scripting additions).

choose file of type {"MooV"} now works as expected. Previously, it allowed the user to choose any file that QuickTime could open.

The choose file name dialog now recognizes packages.

The display dialog command will no longer create a dialog that is too tall for the screen when given a very long string to display.

The display dialog command now displays Japanese text correctly when an applet is running on a Japanese-primary system.

Script Handling Fixes
The do shell script command now works correctly with multiple commands when the administrator privileges parameter is specified.

When the administrator privileges parameter is specified to the do shell script command, the 5 minute authentication timestamp now applies only to the current script.

The do shell script command now returns the correct error code (-128) if the user cancels the authentication dialog.

The run script command no longer causes a stack overflow error if the direct parameter is not specified.

File Handling Fixes
The info for command now returns the correct file type and file creator for packages that don’t contain a PkgInfo file (e.g., scripting additions).

read before <delimiter> as date no longer causes an error.

Miscellaneous Fixes
The using parameter to the say command now works correctly when Speech Recognition is turned on.

The using parameter to the say command no longer causes an error if the specified voice is not capitalized correctly.

the clipboard as Unicode text now works correctly when the clipboard contains styled text but no Unicode text.

Error checking and reporting has been improved.

Several errors in the Standard Additions dictionary have been fixed.


Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

Offline

 

#2 2006-08-27 04:21:57 am

Kevin Bradley
Administrator
From: Independence, MO
Registered: 2006-03-13
Posts: 548
Website

Re: AppleScript 1.10 (Tiger 10.4)

New Features and Enhancements In AppleScript

Strings
A new Considering/Ignoring attribute has been added that affects string comparisons. The numeric strings attribute specifies that numeric substrings should be collated by their numeric value. For example, “version 1.9” is less than “version 1.10”.

A new string constant named quote has been added whose value is "\"".

String concatenation now uses the richer of the two operands. If either operand is Unicode, the result will be Unicode.

Dates
The date class now has hours, minutes, and seconds properties. The hours property always uses a 24-hour clock.

The month property of the date class can now be set to an integer.

The weekday constants can now be coerced to numbers. Sunday is 1.

Math
The coercion from version to real has been changed to allow the second and third parts of the version number to be 0..15 instead of 0..9. As a result, the version 1.2.3 will now coerce to the real number 1.0203. Previously, it would coerce to the real number 1.23.

Applications and Applets
A tell application "AppName" statement can now use the application’s short name (CFBundleName) if the application is currently running.

If a script application (applet) encounters an error, the “Edit” button in the error dialog will now open the applet in the default script editor. The default script editor can be set using the new AppleScript Utility application.

If an applet has a custom startup screen, the startup screen will now be displayed when the user selects the “About appletName” menu item. Previously, the generic applet About Box was displayed.

If a bundled applet has a custom startup screen stored in Contents/Resources/description.rtfd/TXT.rtf, that startup screen will be displayed instead of the startup screen stored in the bundle’s 'TEXT' and 'styl' resources. Note that non-text startup screens are not currently supported.

Bundled applets now display localized menus and dialogs.

The applet startup screen dialogs and error dialogs now conform to the Aqua Human Interface Guidelines.

The applet About Box has been updated.


Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

Filed under: AppName

Offline

 

#3 2006-08-27 04:02:11 am

Kevin Bradley
Administrator
From: Independence, MO
Registered: 2006-03-13
Posts: 548
Website

Re: AppleScript 1.10 (Tiger 10.4)

AppleScript Bug Fixes

Strings
Strings that contain only a plus or minus sign, can no longer be coerced to a number.

The numeric value classes, the enumerated value class (typeEnumerated), and the type value class (typeType) can now be coerced to and from Unicode text and styled text.

The Unit Type value classes (e.g., miles, gallons) can now be coerced to and from Unicode text.

The version class (typeVersion) can now be coerced to Unicode text.

Plain text (typeText) can now be coerced to styled text (typeStyledText).

Getting the first word of an empty Unicode string no longer causes a crash.

Getting an arbitrary element of Unicode text using some (e.g., some word of theUnicodeText) now produces more random results.

Getting the count of a non-existent element of Unicode text (e.g., count files of theUnicodeText) now returns 0. Previously, it returned the number of characters.

Getting the count of the paragraphs or text items of an empty Unicode string now returns 1 instead of 0.

A problem that caused some styled text comparisons to fail when the primary language was set to Japanese has been fixed.

Backslash characters and Yen sign characters will now compile correctly when the primary language is set to Japanese.

The '¬', '÷', '≠', '≤', and '≥' characters will now compile correctly when the primary language is set to Japanese, Korean, or Chinese.

URL and File Specs
A coercion from typeFileURL to object specifier has been added.

Coercing a file specification (typeFSS) to an object specifier now works correctly for filenames that are longer than 31 characters.

Coercing an alias to an object specifier would crash in certain circumstances if the alias could not be resolved. This has been fixed.

"file://localhost" as URL no longer causes a crash.

Getting the POSIX path of a path string that is already POSIX now returns the correct results.

Long volume/folder/file names no longer cause errors.

Applications
tell application "AppName" will now look for a Mac OS X application named “AppName.app” before looking for a Classic application named “AppName”. Previously, the Classic application was found first.

Long application names are no longer truncated when used in a tell statement.

Long application names are no longer truncated in the “Where is xxx?” dialog.

Scriptable Cocoa applications that contain Resource Manager resources, but do not contain an 'aete' resource, are now recognized as scriptable.

A compilation problem that caused the last character of an enhanced application URL specification to be removed has been fixed.

Bundled applets created using AppleScript 1.9.x always appear to be named “applet” when targeted from a remote machine. This has been fixed for bundled applets created with AppleScript 1.10 and later.

Bundled applets created using AppleScript 1.9.x erroneously display the “Open in the Classic environment” checkbox in the Finder’s Get Info window. This has been fixed for bundled applets created with AppleScript 1.10 and later.

AppleScript Internal Fixes
If a with timeout statement specifies a timeout of more than 8947848 seconds, the timeout will be set to 8947848 seconds. Previously, an error was reported.

Distance and weight conversions are now more accurate.

The size of the internal symbol table has been increased which enables larger scripts to be compiled.

The size of the internal runtime stack has been increased which enables larger static lists to be created.

The default formatting is now localizable.

The “References” formatting category is no longer used.

A divide by 0 within a try block within a repeat block no longer causes a hang.

Crashes that would occur in certain circumstances after garbage collection have been fixed.

Memory leaks have been fixed.

Several error reporting problems have been fixed.


Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

Filed under: AppName

Offline

 

#4 2006-08-27 03:50:03 am

Kevin Bradley
Administrator
From: Independence, MO
Registered: 2006-03-13
Posts: 548
Website

Re: AppleScript 1.10 (Tiger 10.4)

AppleScript 1.10 was released as part of Mac OS X version 10.4 and requires Mac OS X version 10.4 or later.  Since this was the first Tiger release of AppleScript, there are a bunch of changes.  Some are bug fixes, other are enhancements of existing features, and some are downright new.

Apple provided the usual disclaimer in their release note.  It states that scripts written for older versions of AppleScript will work in 1.10 and that scripts written for 1.10 will work with versions back to version 1.1 if they don't use features added since that version.

Notes:

Version Numbering
Since this is the first "double-digit" version of AppleScript, Apple noted that you must use the new considering numeric strings statement before comparing this version with previous versions.  If you don't, "1.10" will compare less than "1.9" in a normal string comparison.

If your script converts the version to a real number (via coercion) then you may also have problems, since the version number is now allowed to contain 2 digits for both the second and third digit.  So now version 1.2.3 would coerce to 1.0203 instead of 1.23 as a real number.  And 1.10 coerces to 1.10 and the previous version, 1.9.3 coerces to 1.0903 in order to keep 1.10 larger than 1.0903.

Apple suggests using the Gestalt version (system attribute "ascv") to do version comparisons.

Strings
String concatenation has been changed to that if the strings being concatenated are of differing string types, the "richer" type is used for the result.  This means that if you concatenate a plain string with a unicode text string, the result will be unicode text, since it supports more characters.

Strings containing only a "+" or "-" can no longer be coerced to a number (assumably zero).

Using count to get the number of paragraphs or text items of a unicode string now results in a value of 1, not 0.  This is because the string is considered to contain at least 1 paragraph or text item, it just may be empty.  This is different that the method used for standard text strings.  With standard strings, the result is 0.

The implicitly encoded text types typeText, typeCString, and typePString have been deprecated since 1.9.2, but Apple reiterated this in their release notes.  Bottom line: Don't use them.

Do Shell Script
Do shell script should not be used with both administrator privileges AND the sudo shell command.  If you do so, sudo will hang the script waiting for input on a non-existant terminal.

Do shell script now uses setuid-root for privileges to run scripts rather than root.  Some things will operate differently because of this; perl will no longer accept -e options.  This change could break existing scripts that rely on root privileges.

Error codes for do shell script are different.  No information on HOW they are different.

Miscellaneous Changes
Path to me now returns the right path for compiled scripts even if they are run using the run script command.

Mount volume can no longer mount OS 9 server volumes using an AppleTalk server name.  You must use the TCP server name or an IP address.

If you use display dialog with the with icon parameter and the icon doesn't exist, Applescript will report an error.  In the past, this was ignored.

The list returned by list disks is now unicode text, not standard text.
1.9.2.


Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

Offline

 

#5 2006-08-27 04:37:38 am

Kevin Bradley
Administrator
From: Independence, MO
Registered: 2006-03-13
Posts: 548
Website

Re: AppleScript 1.10 (Tiger 10.4)

New Features and Enhancements In Standard Additions

User Interaction
The with prompt and with title parameters to the choose application command now support Unicode text.

The choose application dialog box now remembers the column widths.

The choose file and choose folder commands now have a showing package contents parameter that specifies whether packages should be treated as folders. The default is false.

The of type parameter to the choose file command now accepts either a list of file types or a list of type identifiers.

The choose from list command now has a with title parameter that specifies the title of the dialog. By default, the dialog does not have a title.

The choose from list command now supports Unicode text.

The choose from list command now supports long prompts and multi-line prompts.

The choose from list dialog now allows a text item to be selected by typing the first few characters of its name.

The choose from list dialog now supports full keyboard access.

A new choose remote application command has been added that enables the user to choose a running application on a remote machine or on the local machine.

The choose URL command now supports CIFS file servers.

A new display alert command has been added that displays a standard alert dialog that conforms to the Aqua Human Interface Guidelines.

Note that standard alert dialogs have the following restrictions:
• A default button is required. The right-most button will be the default button unless the user specifies otherwise using the default button parameter.
• The cancel button cannot be the same as the default button.

The display dialog command now has a cancel button parameter that specifies the name or number of the cancel button.

The display dialog command now has a hidden answer parameter that specifies whether editable text should be displayed as bullets. The default is false.

The display dialog command now has a with title parameter that specifies the title of the dialog. By default, the dialog does not have a title.

The default answer parameter to the display dialog command now supports Unicode text and linefeeds.

The with icon parameter to the display dialog command now accepts an alias or file reference to a “.icns” file.

The display dialog dialog now supports full keyboard access.

The  display dialogdialog now uses Aqua icons for note, caution, and stop.

The  display dialog dialog now conforms to the Aqua Human Interface Guidelines.

Script Handling
The do shell script command now displays the Mac OS X authentication dialog in order to obtain administrator privileges.

The do shell script command now has a user name parameter that specifies an administrator account. This parameter can be used along with the password parameter and the administrator privileges parameter in order to execute commands as an administrator without displaying an authentication dialog.

File Handling
The info for command now has a size parameter that specifies whether the size of the item should be returned. The default is true.

The info for command now returns the type identifier for files.

The info for command now returns the short name (CFBundleName) for applications.

The info for command now returns the busy status for packages. The busy status is set to true if the package is marked as incomplete (kExtendedFlagObjectIsBusy).

The info for command now sets the busy status for non-bundled files to true if either the file is marked as open (kioFlAttribFileOpenBit) or the file is marked as incomplete (kExtendedFlagObjectIsBusy).

The list disks command now supports disk names that contain Unicode characters. The return value from the list disks command is now a list of Unicode strings. Previously, it was a list of plain strings.

Miscellaneous Commands
A new localized string command has been added that returns a localized string for a specified key.

The path to command now has a folder constant for the Automator workflows folder.

The path to me command now returns the correct result for compiled scripts, including those that are run using the run script command.

A new path to resource command has been added that returns an alias to the specified resource.

The say command now accepts Unicode text and numbers as the direct parameter and as the displaying parameter.

A new system info command has been added that returns a record containing information about the system.


Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

Offline

 

#6 2006-08-27 04:41:59 am

Kevin Bradley
Administrator
From: Independence, MO
Registered: 2006-03-13
Posts: 548
Website

Re: AppleScript 1.10 (Tiger 10.4)

Developer Information

A new Open Scripting Architecture (OSA) API has been added that lets you get the scripting dictionary of an application as an sdef (see ASDebugging.h and sdef(5)). If the target application does not have a true sdef but does have an 'aete' or Cocoa-generated dictionary, it will translate that, so the API will work on any scriptable application.
[code]OSAError OSACopyScriptingDefinition (
   const FSRef * ref,
   SInt32 modeFlags,
   CFDataRef * sdef
);[/code]
Parameter Descriptions
ref              An FSRef to the application file or bundle.
modeFlags   There are no flags currently defined; pass 0.
sdef            If the result is noErr, a CFDataRef containing the sdef XML, which you are responsible for releasing; otherwise undefined.

Discussion
To provide an sdef in your application, put the sdef in the Resources folder of your bundle, and add the key “OSAScriptingDefinition” to your Info.plist with the value of the sdef name (e.g., “MyApplication.sdef”).

Known Bugs and Limitations
Dynamic generation of sdefs is not supported. sdefs in single-file applications are not supported.

A crash that occurred when calling OSAScriptError() with the kOSAErrorApp selector has been fixed.

The osascript command line tool now passes the kOSAModeCompileIntoContext mode flag when compiling a text script.

The osascript command line tool can now call scripts that take parameters. Any arguments following the script will be passed as a list of strings to the direct parameter of the “run” handler.


Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

Offline

 

#7 2007-04-29 04:05:14 am

Kevin Bradley
Administrator
From: Independence, MO
Registered: 2006-03-13
Posts: 548
Website

Re: AppleScript 1.10 (Tiger 10.4)

Applescript Release Notes for the Mac OS X 10.4 minor releases are available on the Apple Developer Connection site at this location.


Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.050 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)