• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "icon note" in Tiger now a generic icon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "icon note" in Tiger now a generic icon


  • Subject: Re: "icon note" in Tiger now a generic icon
  • From: Michael Henley <email@hidden>
  • Date: Mon, 28 Nov 2005 22:53:50 -0500

Ok, this version should finally address the 'as alias' issue. I also put in an option to view just large icons, just small ones, or both.

Mike

-- contact_mike("Compose_Dialog_Icon_0.1.2") -- composes mail to the author and cancels script
set icon_delay to 1
set x to 0
set an_icon to ""
set icon_size to button returned of (display dialog "Which icon sizes would you like to view?" & return & "(10k and up is considered 'Large')" with title "Compose Dialog Icon 0.1.2" buttons {"Small", "Small + Large", "Large"} default button 2)
if icon_size is "Small" then
tell application "Finder" to set core_icons to the name of every item of (((path to library folder from system domain as string) & "CoreServices:CoreTypes.bundle:Contents:Resources:") as alias) whose name extension is "icns" and size is less than 10000
else if icon_size is "Small + Large" then
tell application "Finder" to set core_icons to the name of every item of (((path to library folder from system domain as string) & "CoreServices:CoreTypes.bundle:Contents:Resources:") as alias) whose name extension is "icns"
else if icon_size is "Large" then
tell application "Finder" to set core_icons to the name of every item of (((path to library folder from system domain as string) & "CoreServices:CoreTypes.bundle:Contents:Resources:") as alias) whose name extension is "icns" and size is greater than 10000
end if
set delay_msg to "Enter a number of seconds to pause between icons:"
repeat
display dialog delay_msg default answer icon_delay with title "Compose Dialog Icon 0.1.2" buttons {"Quit", "Choose Icon", "Start"} cancel button 1 default button 3
tell result to set {icon_delay, nav_button} to {text returned, button returned}
try
set icon_delay to icon_delay as integer
exit repeat
on error
set delay_msg to "Error: Number of seconds must be a positive integer."
end try
end repeat
if nav_button is "Choose Icon" then
repeat
set an_icon to (choose from list core_icons default items an_icon) as string
if an_icon is "false" then error number -128
repeat with z from 1 to the length of core_icons
if item z of core_icons is an_icon then exit repeat
end repeat
set x to z
set an_icon to item x of core_icons
set nav_button to button returned of (display dialog "Icon Title:" with title "Display Dialog" default answer an_icon with icon (path to resource an_icon in bundle ((path to library folder from system domain as string) & "CoreServices:CoreTypes.bundle") as alias) buttons {"Quit", "Choose Icon", "Start"})
if nav_button is "Start" then
set x to x - 1
exit repeat
else if nav_button is "Quit" then
exit repeat
end if
end repeat
end if
if nav_button is "Start" then repeat
set x to x + 1
if x is greater than the length of core_icons then set x to 1
set an_icon to item x of core_icons
set nav_button to button returned of (display dialog "Icon Title:" with title "Display Dialog" default answer an_icon with icon (path to resource an_icon in bundle ((path to library folder from system domain as string) & "CoreServices:CoreTypes.bundle") as alias) giving up after icon_delay buttons {"Quit", "Previous", "Pause"} default button 3)
if nav_button is not "" then repeat
if nav_button is "Previous" then
set x to x - 1
if x is 0 then set x to the length of core_icons
set nav_button to pause_view(item x of core_icons)
else if nav_button is "Next" then
set x to x + 1
if x is greater than the length of core_icons then set x to 1
set nav_button to pause_view(item x of core_icons)
else if nav_button is "Pause" then
set nav_button to pause_view(item x of core_icons)
else if nav_button is "Resume" then
set x to x - 1
exit repeat
else if nav_button is "Quit" then
exit repeat
end if

end repeat
if nav_button is "Quit" then exit repeat
end repeat
if nav_button is "Quit" then handle_quit(item x of core_icons)
on pause_view(an_icon)
button returned of (display dialog "Icon Title:" with title "Display Dialog" default answer an_icon with icon (path to resource an_icon in bundle ((path to library folder from system domain as string) & "CoreServices:CoreTypes.bundle") as alias) buttons {"Resume", "Previous", "Next"} default button 1)
end pause_view
on handle_quit(an_icon)
set icon_code to "display dialog \"\" with title \"\" default answer \"\" with icon (path to resource \"" & an_icon & "\" in bundle ((path to library folder from system domain as string) & \"CoreServices:CoreTypes.bundle\") as alias)"
display dialog "Sample code for " & quoted form of an_icon with title "Quit" default answer icon_code buttons {"Quit", "Reveal Icon in Finder", "Copy Code to Clipboard"} cancel button 1 default button 3
tell result to set {icon_code, copy_option} to {text returned, button returned}
if copy_option is "Reveal Icon in Finder" then
set icon_path to ((path to library folder from system domain as string) & "CoreServices:CoreTypes.bundle:Contents:Resources:" & an_icon) as alias
tell application "Finder"
activate
set icon_window to make new Finder window
tell icon_window
set target to icon_path
set current view to icon view
set toolbar visible to false
end tell
tell icon view options of icon_window
set arrangement to arranged by name
set shows icon preview to true
set icon size to 128
end tell
reveal icon_path
end tell
else if copy_option is "Copy Code to Clipboard" then
set the clipboard to icon_code
end if
end handle_quit
to contact_mike(script_revision)
open location "mailto:email@hidden?subject="; & script_revision
error number -128
end contact_mike




On Nov 28, 2005, at 22:14:14, Michelle Steiner wrote:

Yes; I tested it and it failed. By moving "as alias" inside the final paren in each instance where it was outside the parens, I got it to run. No need to add any more "as alias"; just move them.

-- Michelle

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: "icon note" in Tiger now a generic icon
      • From: Michelle Steiner <email@hidden>
    • Re: "icon note" in Tiger now a generic icon
      • From: Gnarlodious <email@hidden>
References: 
 >Re: "icon note" in Tiger now a generic icon (From: Mr Tea <email@hidden>)
 >Re: "icon note" in Tiger now a generic icon (From: Michelle Steiner <email@hidden>)
 >Re: "icon note" in Tiger now a generic icon (From: Michael Henley <email@hidden>)
 >Re: "icon note" in Tiger now a generic icon (From: Michelle Steiner <email@hidden>)
 >Re: "icon note" in Tiger now a generic icon (From: Michael Henley <email@hidden>)

  • Prev by Date: Re: "icon note" in Tiger now a generic icon
  • Next by Date: Re: "icon note" in Tiger now a generic icon
  • Previous by thread: Re: "icon note" in Tiger now a generic icon
  • Next by thread: Re: "icon note" in Tiger now a generic icon
  • Index(es):
    • Date
    • Thread