• 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: Skim
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Skim


  • Subject: Re: Skim
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 12 May 2017 09:48:49 +0200


Le 12 mai 2017 à 03:44, Jean-Christophe Helary <email@hidden> a écrit :

Chris,

The only difference between your script and Yves is the:

set frontmost to true

That appears after

     tell application process "Skim"

in his script.

When I add that to yours, it works.

Now, as I wrote earlier, I'm curious why my faulty syntax worked with some items and not others...

Jean-Christophe

It seems that you didn't look carefully !

Your instruction :
click menu item 10 of menu 11 of menu bar 1

Mine :
click menu item 10 of menu 1 of menu bar item 11 of menu bar 1

Maybe it explains why you think that your instruction does the job in other cases.

Just a question : are you just getting a script reaching its end (what I get) or are you really getting a script gathering the different windows in a sigle PDF ?

As for me Skim fails to do the job, when I want to concat several PDFs I use a script borrowed o Shane STANLEY.

use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "Quartz"

on combineFiles:inFiles savingTo:destPosixPath
-- make URL of the first PDF
set inNSURL to current application's class "NSURL"'s fileURLWithPath:(POSIX path of item 1 of inFiles)
-- make PDF document from the URL
set theDoc to current application's PDFDocument's alloc()'s initWithURL:inNSURL
-- loop through the rest
set oldDocCount to theDoc's pageCount()
set inFiles to rest of inFiles
repeat with aFile in inFiles
-- make URL of the next PDF
set inNSURL to (current application's class "NSURL"'s fileURLWithPath:(POSIX path of aFile))
-- make PDF document from the URL
set newDoc to (current application's PDFDocument's alloc()'s initWithURL:inNSURL)
-- loop through, moving pages
set newDocCount to newDoc's pageCount()
repeat with i from 1 to newDocCount
-- get page of old PDF
set thePDFPage to (newDoc's pageAtIndex:(i - 1)) -- zero-based indexes
-- insert the page
(theDoc's insertPage:thePDFPage atIndex:oldDocCount)
set oldDocCount to oldDocCount + 1
end repeat
end repeat
set outNSURL to current application's class "NSURL"'s fileURLWithPath:destPosixPath
-- save the new PDF
(theDoc's writeToURL:outNSURL)
end combineFiles:savingTo:

set inFiles to (choose file of type {"pdf"} with prompt "Choose your PDF files:" with multiple selections allowed)
set destPosixPath to POSIX path of (choose file name default name "Combined.pdf" with prompt "Save new PDF to:")
its combineFiles:inFiles savingTo:destPosixPath


Yvan KOENIG running Sierra 10.12.4 in French (VALLAURIS, France) vendredi 12 mai 2017 09:47:46




 _______________________________________________
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: Skim
      • From: Jean-Christophe Helary <email@hidden>
References: 
 >Skim (From: Jean-Christophe Helary <email@hidden>)
 >Re: Skim (From: Christopher Stone <email@hidden>)
 >Re: Skim (From: Jean-Christophe Helary <email@hidden>)

  • Prev by Date: Re: Skim
  • Next by Date: Re: Skim
  • Previous by thread: Re: Skim
  • Next by thread: Re: Skim
  • Index(es):
    • Date
    • Thread