Recent

Author Topic: [SOLVED] Searching for a bookmark in MS Word  (Read 7419 times)

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Searching for a bookmark in MS Word
« Reply #15 on: September 28, 2016, 02:10:36 pm »
Now i know what when wrong >:(
Because i have a space in my directory it won't run.


But this works:
Code: [Select]
osascript "/Documenten/Lazarus/Ledenadministratie OSX/db_scriptmsw.applescript"
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: [SOLVED] Searching for a bookmark in MS Word
« Reply #16 on: September 28, 2016, 03:17:07 pm »
So finally this is what it is:
Code: Pascal  [Select][+][-]
  1. // Open MS Word with a document
  2. OpenDocument(Doc);
  3. // Run the Script
  4. fpsystem ('osascript "/Documenten/Lazarus/Ledenadministratie OSX/db_scriptmsw.applescript"');
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: [SOLVED] Searching for a bookmark in MS Word
« Reply #17 on: September 28, 2016, 05:33:03 pm »
You can even do without the OpenDocument argument.
So the code looks like this:
Code: Pascal  [Select][+][-]
  1. // Run the Script
  2. fpsystem ('osascript "/Documenten/Lazarus/Ledenadministratie OSX/db_scriptmsw.applescript"');


And your script need to look something like this:
Code: [Select]
tell application "Microsoft Word"
  Open "/Users/SomeUser/Documents/Some_Document.docx"
  Delay (3)
  ...
  ...
end tell
I am using the delay to make sure that MS Word has started fully
« Last Edit: September 28, 2016, 05:35:13 pm by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

 

TinyPortal © 2005-2018