image ResEx Logo
App Makeovers
Boot Images
Boot Panels
Cell Phone Themes
Clocks
Desktop Pictures
Desktop Snapshots
Dock Poofs
Growl Styles
Icons
iTunes Skins
Links List
Login Panels
Mac OS X Mods
Mac OS X Themes
Mighty Mouse Cursors
Photoshop Goodies
REALbasic
Safari Stuff
Screen Savers
Software Archive
Software Reviews
Splash Screens
System Level Icons
Unix & The Terminal
Uploads
Widgets & Widgets

Homepage



AppleScript Scripts
Scripts made for the people who create scripts.

Contents:
File type/creator droplet
Enhance dialog boxes

Here's an Applescript for those of you who distibute your Applets from John Grow:

I am submitting to you this wicked simple (but really useful) AppleScript that I made. This script is like a lot of the others I've seen in the AppleScript listing, EXCEPT...in those others, you have to change the creator code in the script every time.

Not in this one. This one opens a dialog box when you drop a file on it. The dialog box contains the file name and file type, but puts the creator code in a default answer box, allowing you to edit it right there. No more editing the script every time. This has come in really handy for me because I deal with cross-platform all the time, and I'm too lazy to edit the script every time I need this thing, which is several times a day.

on open (theList)
tell application "Finder"
repeat with theItem in theList
if class of theItem is file then
set locked of theItem to false
end if
set fileName to name of theItem
set fileType to file type of theItem
set creatorType to creator type of theItem
set dialogResult to display dialog "File name: " & fileName & return & ¬
"File Type: " & fileType & return & "Creator Code: " buttons "OK" ¬
default button 1 default answer creatorType
set creatorType to text returned of dialogResult
set creator type of theItem to creatorType
end repeat
end tell
end open

Devin Teske describes how to enhancing your AppleScripts using ResEdit to add icons to dialog boxes :

  1. Using ResEdit, open the AppleScript program you made.
  2. Create a new 'cicn' resource.
  3. Draw or paste a new color or B&W icon, and a mask for it.
  4. Now choose the new icon resource and press Command-I.
  5. Type a four or five digit number in the 'ID' box.

Remeber the number. Whenever you want to use that icon, use that number. The icon will not be visible in the Script Editor. Only in the Finder after you save it to disk and run it from there.

A better way to reference the icon is to set up a property within your script (property iconName : iconNumber) with a name of choice and the number you gave it. For Example :

    property myLogo : 29531

Then you can reference the icon with that name (in this case, myLogo). Then you can reference the icon like this :

    display dialog "My own icon" buttons "OK" default button 1 with icon myLogo

The icon won't be displayed when run in the Script Editor. You have to save it and run it as an application from the Finder.

Evan Francois adds this comment:

One must be sure it's **their** script displaying the dialog. For example, if the display dialog statement falls within a tell application "Finder", end tell block, it won't work. In cases like that, be sure to nest the display dialog statement within a tell me, end tell pair.

Back to the Archive


App Makeovers
Boot Images
Boot Panels
Cell Phone Themes
Clocks
Desktop Pictures
Desktop Snapshots
Dock Poofs
Growl Styles
Icons
iTunes Skins
Links List
Login Panels
Mac OS X Mods
Mac OS X Themes
Mighty Mouse Cursors
Photoshop Goodies
REALbasic
Safari Stuff
Screen Savers
Software Archive
Software Reviews
Splash Screens
System Level Icons
Unix & The Terminal
Uploads
Widgets & Widgets

Homepage


Loading
Maintained by the Staff of ResExcellence. This entire site ©1997-2006 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement.