|
Veteran Member
Join Date: Jun 2006
Location: Florida
|
I'm playing with AppleScript trying to learn the language and am running into a little snag. I'm trying to create a script that will take all the images on the Desktop and then take them into Picturesque, resize them and save them into a folder on the Desktop. Problem is I keep getting an error saying that "no result was returned from some part of this expression." The part highlighted after the error reports is the first set line: set open images etc. I assume it's looking for something else to happen after the open, but I can't figure it out. Any suggestions?
Code:
tell application "Picturesque"
set open images to open "Users:Justin:Desktop"
set save all images to location to save all images to location "Users:Justin:Desktop:Completed" with properties
{fileType:PNG, hideFileExtension:true, maximumWidth:100}
end tell |
|
|
quote |
|
Member
Join Date: Aug 2006
Location: Orlando, Florida
|
I'm probably not qualified to answer your question, but is "save all images to location" supposed to be repeated? Just stuck out to me is all...
Good luck! |
|
|
quote |
|
Veteran Member
Join Date: Jun 2006
Location: Florida
|
The developer sent me some sample scripts to get me going. My mistake was in using set. It should have read
Code:
open images "Users:Justin:Desktop" I was trying to do too much I guess. |
|
|
quote |
|
New Member
Join Date: Jul 2009
|
Hi
Would be interesting to share your sample scripts as I get some difficulties as well. Thanks |
|
|
quote |
|
Member
Join Date: Aug 2006
Location: Orlando, Florida
|
Can you say which developer? Is this developer the author of a book or something? If you're finding it helpful, I'd love to know about it too!
|
|
|
quote |
|
On twitter: @bwyatt
Join Date: Mar 2005
Location: Near Indianapolis
|
|
|
|
quote |
|
Travels via TARDIS
Join Date: Aug 2005
Location: Earthsea
|
What is your end goal in learning AppleScript? I personally find the language terribly difficult to use / master, but the application scriptability is exposed through another fantastic API called the ScriptingBridge framework. This exposes the same functionality in a manner that is usable from Python, Ruby, and Objective-C (at the core).
As a programmer, I personally find the latter method to be much easier. The AppleScript grammar is often called a read-only language; you can't understand what it does until it's written, and then it reads like plain English. The opposite is Perl, being a write-only language. ![]() Apparently I call the cops when I see people litter. |
|
|
quote |
|
Veteran Member
Join Date: Jun 2006
Location: Florida
|
The end goal would be to be able to use it when needed and to give me something to learn. I'm curious about ScriptingBridge. Any suggested resources?
|
|
|
quote |
|
Travels via TARDIS
Join Date: Aug 2005
Location: Earthsea
|
Quote:
If you want to write AppleScripts that you can use to automate frequent user tasks, your best bet is AppleScript. There are facilities for adding them to the Services menu, I believe. However, if you want to use it from other programs to automate things *not* invoked by the user, ScriptingBridge is probably your best bet. Of course, using the ScriptingBridge framework requires you already be familiar with Objective-C, or at least the use of Objective-C frameworks from within Python or Ruby. (I prefer Python, myself.) Apparently I call the cops when I see people litter. |
|
|
|
quote |
|
Veteran Member
Join Date: Jun 2006
Location: Florida
|
Thank you. Yeah, my interest was peeked by the automation aspect of AppleScript, especially in getting images and such ready for the web. But I'll check out Scripting Bridge as well and see what flushes out.
|
|
|
quote |
| Posting Rules | Navigation |
|
|
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Learning a new Language | Argento | AppleOutsider | 6 | 2008-10-20 17:41 |
| Learning French | evan | AppleOutsider | 18 | 2007-08-31 17:16 |
| Learning OS X | osuchris | Apple Products | 5 | 2006-06-21 13:59 |
| Help with applescript: how to get a url with specified name | ironlung | Programmer's Nook | 4 | 2006-05-01 03:52 |
| Learning Cocoa? | pmazer | Programmer's Nook | 10 | 2005-11-23 19:56 |