Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Executing a script upon linking a file (Read 2252 times)
Paul Atlan
Full Member
*
Offline



Posts: 45
Abu Dhabi
Executing a script upon linking a file
Dec 11th, 2013, 2:53pm
 
My work involves tons of power points. I'd like to do some textual analysis on some of them, so I've developed an apple script (coupled to a Keyboard Maestro macro) to convert the .pptx files to .txt or .rtf files (via pdf and pdf2text utility).
Now I have to manually run the script on each ppt, open the rtf file and copy past the text in the TB note. It works, but it's tedious.

I've had the bright idea that I could use the scripting capability of TB: get my apple script to run as soon as a file of the proper format is linked.
Unfortunately it seems the script will run each and every time I open the note? Also, I'm not sure how to access the linked file in the script?

Any pointers
Thanks.
Back to top
 
 
WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Executing a script upon linking a file
Reply #1 - Dec 11th, 2013, 4:29pm
 
Ah -- that's an interesting idea, but the script field isn't meant for that.

What I'd do is have a container or a Smart Adornment or an agent that performs an action.

   1) If we're already converted, do nothing.
   2) Use runCommand to invoke the script, passing it suitable arguments
   3) Then, mark the note as "converted"
Back to top
 
 
WWW   IP Logged
Paul Atlan
Full Member
*
Offline



Posts: 45
Abu Dhabi
Re: Executing a script upon linking a file
Reply #2 - Dec 11th, 2013, 8:30pm
 
Thanks for that. Opening the manual for RunCommand as we speak.

Paul.
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print