The convert notes AppleScript command does work for me. And nothing really
changed. Are you sure the file does have these types of notes?
The highlightNote should be a list, I think, and it looks rather convoluted.
Also did you set the myFile and skimNotes variables properly?
Does the Convert Note action work in the app?
Christiaan
> On 28 Jan 2018, at 18:37, Jan David Hauck <[email protected]> wrote:
>
> Sorry, I didn't provide the full script, but I do set numberOfNotes. This is
> the full script. It had been working flawlessly before.
>
>
> tell application "Skim"
> launch
> open myFile
> set theDocument to document 1
> convert notes theDocument
>
> set noteTypeStrings to {"Box", "Underline", "Freehand"}
> set noteTypes to {}
> repeat with noteTypeString in noteTypeStrings
> set noteTypeString to contents of noteTypeString
> else if noteTypeString is "Box" then
> set end of noteTypes to box note
> else if noteTypeString is "Underline" then
> set end of noteTypes to underline note
> else if noteTypeString is "Freehand" then
> set end of noteTypes to freehand note
> end if
> end repeat
> set highlightNote to highlight note
> set lineNote to noteTypes
> set highlightColor to {63798, 59381, 37996} -- New Yellow
> set linesColor to {45073, 3851, 6345} -- Dark Red
> set numberOfNotes to 0
> tell contents of theDocument
> repeat with aNote in (get notes)
> set aNote to contents of aNote
> set theType to get type of aNote
> if highlightNote contains theType then
> set color of aNote to highlightColor
> set numberOfNotes to numberOfNotes + 1
> else if lineNote contains theType then
> set color of aNote to linesColor
> set numberOfNotes to numberOfNotes + 1
> end if
> end repeat
> end tell
>
> if numberOfNotes = 0 then
> close theDocument saving no
> else
> save theDocument in skimNotes as "Skim Notes"
> close theDocument saving no
> end if
> end tell
>
>
> Jan David Hauck, Ph.D.
> Lecturer
> Department of Anthropology
> University of California, Los Angeles
> http://ucla.academia.edu/hauck <http://ucla.academia.edu/hauck>
> http://www.anthro.ucla.edu/content/jan-david-hauck
> <http://www.anthro.ucla.edu/content/jan-david-hauck>
>
>
> On Sun, Jan 28, 2018 at 1:06 AM, Christiaan Hofman <[email protected]
> <mailto:[email protected]>> wrote:
> You never seem to assign the numberOfNotes variable in your script.
>
> Christiaan
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users