The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Reveal Script (switch alternative) Thread Tools Search this Thread Display Modes
If any knows how to combine a script (scpt) and an icon (icns) to create a script with an icon (without using the GUI) please let me know.

I'm using git to version control code changes to reveal. Each time I revert, the resource fork containing the icon is deleted. Resource forks are a pain anyway, I'm better without them.

I have resorted to having a pre-iconned scptd script bundle into which I osacompile the applescript. However, OmniFocus doesn't perfectly support script bundles - you can see the main.scpt inside them from the customise toolbar sheet.

What I really want to do is have a command line do the meaning of the following:

osacompile -d -o Reveal.scpt Reveal\ Dev.applescript
osascript <(echo tell Finder to set icon of file "Reveal.scpt" to Reveal.icns)

Yeah I know that's not valid script - but there doesn't appear to BE a valid script to do that.

<i>Update: I know how to do this now (see post later in this thread)</i>

Last edited by Alex Brown; 2008-03-11 at 10:39 AM.. Reason: Clarification
 
Quote:
Originally Posted by Alex Brown View Post
For the moment, please rename Reveal.scpt to Reveal1.scpt.

When you restart omnifocus you should see 3 scripts in the customise toolbar view: Reveal1, Reveal and main.

I expect that Reveal (the new one) and main (the works inside the new one) will operate correctly, and the same as each other. Please let me know if that doesn't work. If it does work, please delete (or backup and delete) Reveal1.scpt and just ignore the script 'main'.
I just deleted both reveals, redownloaded and reinstalled the beta, and it's working. Thanks!
 
To add icons to your script: (makefile format)

inputs: Reveal\ Dev.applescript - text sourcefile
inputs: Reveal.icns - icon with picture in 32x32 icon. (Icon Composer).
====
Reveal.scpt: Reveal\ Dev.applescript Reveal.r
osacompile -d -o "$@" "$<"
setFile -a "E" "$@" # Hide extension
setFile -a "C" "$@" # allow custom icon
Rez Reveal.r -o "$@" # set custom icon using resource script

Reveal.r: Reveal.icns
echo 'read '\''icns'\'' (-16455) "$<";' > "$@"
====
 
Quote:
Originally Posted by Alex Brown View Post
To add icons to your script: (makefile format)

inputs: Reveal\ Dev.applescript - text sourcefile
inputs: Reveal.icns - icon with picture in 32x32 icon. (Icon Composer).
====
Reveal.scpt: Reveal\ Dev.applescript Reveal.r
osacompile -d -o "$@" "$<"
setFile -a "E" "$@" # Hide extension
setFile -a "C" "$@" # allow custom icon
Rez Reveal.r -o "$@" # set custom icon using resource script

Reveal.r: Reveal.icns
echo 'read '\''icns'\'' (-16455) "$<";' > "$@"
====
Or, for simplicity, if you do want to use the GUI, just:
  1. Select the script in the Finder
  2. Use Apple-I to open the Info dialog
  3. Select the icon at the top-left of the dialog
  4. Paste any graphic (of any size)

Last edited by RobTrew; 2008-03-11 at 12:17 PM.. Reason: Reformat for clarity
 
Thanks, I'd been doing that but it's a pain if I have to do that every time the resource fork gets blown. Easier to have a script.
 
Quote:
Originally Posted by Alex Brown View Post
Thanks, I'd been doing that but it's a pain if I have to do that every time the resource fork gets blown. Easier to have a script.
Yes - we tend to oversell the "ease" of the GUI (and the "difficulty" of the command lines and code).
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Icon alternative francola OmniFocus 1 for Mac 14 2010-05-25 03:23 PM
Feature Request: Reveal Command gcrump OmniFocus for iPhone 0 2008-09-03 10:47 AM
Alternative to due dates ptone OmniFocus 1 for Mac 2 2008-08-16 08:46 PM
Alternative Sync joelande OmniFocus 1 for Mac 0 2007-06-01 04:59 PM


All times are GMT -8. The time now is 01:34 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.