DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

has's picture

Unregistered

Feeds

aliases

  • has

has

7 months ago

in My Applescript Problem on Bullcrap
Function definition's fine, but you need to tell the AppleScript compiler to use Yojimbo's terminology when compiling the 'tags' word - right now it's treating it as a variable name but you need it to compile as a Yojimbo keyword. Wrap the 'set ytgs to tags of yItem' line in either a 'tell application "Yojimbo...end tell' block or a 'using terms from application "Yojimbo"...end' block to fix it.

BTW, a useful trick is to use different formatting styles in Script Editor for language keywords, application keywords and variable names. That makes it easier to tell if a particular word is being compiled as a keyword or identifier. (Another tip: using an underline on the application keyword style also lets you see where a multi-word keyword begins and ends.)

Couple of good places to post AppleScript-related queries:

http://lists.apple.com/mailman/listinfo/applesc...
http://www.macscripter.net

1 year ago

in Run Python Script on toxicsoftware.com
Ooh. This _is_ interesting.

"Some work does need to be done to make working with any data (which is represented by NSAppleEventDescriptor objects) more convenient."

Email me if you'd like to discuss using appscript for this. I'll be happy to help out with advice and/or code.

HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

1 year ago

in "Open in TextMate" from Leopard Finder on The Pug Automatic
Pieter: "Very strange, it doesn't work for me."

Try replacing the original 'run' handler with the following code, which should work around a number of longstanding bugs in AppleScript and Finder.


on run
tell application "Finder"
if selection is {} then
try
set finderSelection to {folder of the front Finder window as alias}
on error number -1700
-- 'as alias' coercion will fail if front window is 'Computer'
-- or if no windows are open and nothing is selected on desktop
beep
return -- nothing to open, so stop here
end try
else
-- various bugs in Finder and AppleScript relating to 'as alias list'
-- coercion and/or using it on 'selection' property, so get a list of
-- Finder references and coerce them one at a time in AppleScript
set finderSelection to selection
repeat with itemRef in finderSelection
set itemRef's contents to itemRef as alias
end repeat
end if
end tell
tm(finderSelection)
end run


HTH

has

(p.s. If you're a Ruby fan, you might like to check out rb-appscript which lets you script applications from Ruby in place of AppleScript - see my sig for links. You still have to deal with application bugs and quirks, of course, but at least you don't have to face the AppleScript language's own bugs and quirks as well.;)
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
Returning? Login