Commanding with Use and Search The Web
Commanding with Use and Search The Web
- Subject: Commanding with Use and Search The Web
- From: Alan Kimelman <email@hidden>
- Date: Sun, 03 May 2015 09:56:30 -0700
I like the idea of employing use such as in:
I did not know that use could be employed for applications. I thought it was primarily to be employed for:
use scripting additions use framework "Foundation"
I was also unaware of the command:
search the web for
I cannot find any documentation of this search the web for command.
Are there similar undocumented commands for AppleScript? If this is documented, where would I find that source?
— Alan
On May 2, 2015, at 3:28 AM, Chris Page < email@hidden> wrote:
On May 2, 2015, at 3:14 AM, Chris Page < email@hidden> wrote:
The executive summary is: don't send events to another application unless you mean it. Don't put them inside a tell-application block unless you need to execute it within the other application process. (Or prefix it with a "tell me to …" or "my" to ignore the current target of the tell block.)
To help cut down on the need for tell-application blocks and the resulting "tell me to"'s inside the block, "use" imports terms from applications and AppleScript sends events to wherever the term was imported from.
For example:
use application "Finder" use application "Safari"
set desktopItems to items of the desktop --> Sent to Finder. search the web for "Pomplamouse" --> Sent to Safari.
For terms that are unambiguous, you no longer need to target the application explicitly, and you can mix "current date" in with Finder scripting without putting it inside a "tell Finder" block that would send "current date" to Finder.
-- Chris Page The other, other AppleScript Chris
_______________________________________________
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden