• 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: AS in TextExpander with user interaction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AS in TextExpander with user interaction


  • Subject: Re: AS in TextExpander with user interaction
  • From: Michael Grant <email@hidden>
  • Date: Mon, 07 Sep 2015 22:10:10 -0500

The problem is that the application I'm actually writing in (I tested with BBEdit but I want the snippet to be available anywhere) is not the same as the application where the script is run (TextExpander.) If I don't explicitly call an app to show choose file, I either don't see the dialog, or the result doesn't get passed back to the original application, or both.

For now I've gotten it to work by using Keyboard Maestro instead of TextExpander.

Thanks,
Michael

On Sun, Sep 6, 2015 at 1:39 PM, Christopher Stone <email@hidden> wrote:
On Sep 06, 2015, at 12:25, Michael Grant <email@hidden> wrote:
I'm trying to write an AS snippet that allows the user to insert the contents of an arbitrary text file, but I'm having trouble 1) giving focus to the choose file dialog and then 2) returning focus to the original application for the expansion.
______________________________________________________________________

Hey Michael,

Don't step out of the app-context you're already in, and you don't have to worry about returning to it.

tell application (path to frontmost application as text)
  choose file
end tell

--
Best Regards,
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



--
There's really no such thing as translating. It's all a scam. We basically just make stuff up and try to make it sound plausible.
 _______________________________________________
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

  • Follow-Ups:
    • Re: AS in TextExpander with user interaction
      • From: Christopher Stone <email@hidden>
    • Re: AS in TextExpander with user interaction
      • From: Yvan KOENIG <email@hidden>
References: 
 >AS in TextExpander with user interaction (From: Michael Grant <email@hidden>)
 >Re: AS in TextExpander with user interaction (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: AS in TextExpander with user interaction
  • Next by Date: Re: AS in TextExpander with user interaction
  • Previous by thread: Re: AS in TextExpander with user interaction
  • Next by thread: Re: AS in TextExpander with user interaction
  • Index(es):
    • Date
    • Thread