text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set d to d - (24 * 60 * 60)
|
weekNumberForDate.applescript
|
set matchDate to dateOfFirstWeekForYear(year of d)
|
weekNumberForDate.applescript
|
set nextYearsFirstWeekDate to dateOfFirstWeekForYear((year of d) + 1)
|
weekNumberForDate.applescript
|
if d = nextYearsFirstWeekDate then return 1
|
weekNumberForDate.applescript
|
set weekNumber to 1
|
weekNumberForDate.applescript
|
repeat until d = matchDate
|
weekNumberForDate.applescript
|
set matchDate to matchDate + 604800 -- Add one week worth of seconds
|
weekNumberForDate.applescript
|
set weekNumber to weekNumber + 1
|
weekNumberForDate.applescript
|
return weekNumber
|
weekNumberForDate.applescript
|
on dateOfFirstWeekForYear(y)
|
weekNumberForDate.applescript
|
set d to current date
|
weekNumberForDate.applescript
|
set year of d to y
|
weekNumberForDate.applescript
|
set month of d to 1
|
weekNumberForDate.applescript
|
set day of d to 1
|
weekNumberForDate.applescript
|
repeat until weekday of d is Thursday
|
weekNumberForDate.applescript
|
set d to d + 86400 -- Add one day worth of seconds
|
weekNumberForDate.applescript
|
set d to d - 259200 -- Subtract 3 days worth of seconds
|
weekNumberForDate.applescript
|
return d
|
weekNumberForDate.applescript
|
end dateOfFirstWeekForYear
|
weekNumberForDate.applescript
|
tell weekNumberForDateHelper to return run
|
weekNumberForDate.applescript
|
end weekNumberForDate
|
weekNumberForDate.applescript
|
global activeDocument
|
ColorTool.applescript
|
global openDocuments
|
ColorTool.applescript
|
global otherDocuments
|
ColorTool.applescript
|
global deduplicatedColorNames
|
ColorTool.applescript
|
global colorNameListActiveDoc
|
ColorTool.applescript
|
global dieAntwort
|
ColorTool.applescript
|
global pageCountBool
|
ColorTool.applescript
|
global stopBool
|
ColorTool.applescript
|
global chosenColorReplacement
|
ColorTool.applescript
|
global chosenColorOriginalRepeat
|
ColorTool.applescript
|
global xxx
|
ColorTool.applescript
|
global chosenColorRepeat
|
ColorTool.applescript
|
global swatchType
|
ColorTool.applescript
|
global swatchListAsSwatches
|
ColorTool.applescript
|
global thePath
|
ColorTool.applescript
|
global theWindow
|
ColorTool.applescript
|
property functionChoice : {"Einblenden"}
|
ColorTool.applescript
|
property chosenColor : missing value
|
ColorTool.applescript
|
property chosenColorOriginal : missing value
|
ColorTool.applescript
|
property chosenColorReplacement : missing value
|
ColorTool.applescript
|
tell application id "com.adobe.InDesign"
|
ColorTool.applescript
|
set activeDocument to active document
|
ColorTool.applescript
|
set openDocuments to every document
|
ColorTool.applescript
|
set otherDocuments to every document whose id is not activeDocument's id
|
ColorTool.applescript
|
set colorListActiveDoc to every swatch of activeDocument
|
ColorTool.applescript
|
set stopBool to false
|
ColorTool.applescript
|
set colorList to {}
|
ColorTool.applescript
|
set colorNameList to {}
|
ColorTool.applescript
|
set colorNameListActiveDoc to {}
|
ColorTool.applescript
|
repeat with i from 1 to count openDocuments
|
ColorTool.applescript
|
set colorList to colorList & every swatch of item i of openDocuments
|
ColorTool.applescript
|
repeat with i from 1 to count colorList
|
ColorTool.applescript
|
set colorNameList to colorNameList & name of item i of colorList
|
ColorTool.applescript
|
repeat with i from 1 to count colorListActiveDoc
|
ColorTool.applescript
|
set colorNameListActiveDoc to colorNameListActiveDoc & name of item i of colorListActiveDoc
|
ColorTool.applescript
|
deduplicator(colorNameList) of me
|
ColorTool.applescript
|
functionChooser() of me
|
ColorTool.applescript
|
if stopBool is true then
|
ColorTool.applescript
|
displayTheEnd() of me
|
ColorTool.applescript
|
to deduplicator(l)
|
ColorTool.applescript
|
set deduplicatedColorNames to {}
|
ColorTool.applescript
|
repeat with i from 1 to count l
|
ColorTool.applescript
|
set x to (l's item i)
|
ColorTool.applescript
|
if x is not in deduplicatedColorNames then set end of deduplicatedColorNames to x
|
ColorTool.applescript
|
deduplicatedColorNames
|
ColorTool.applescript
|
end deduplicator
|
ColorTool.applescript
|
on functionChooser()
|
ColorTool.applescript
|
set functionChoice to choose from list {"Unbenuzte Farben löschen", "Unbenannte Farben hinzufügen", "Farben löschen und ersetzen", "Farben verteilen", "Farbe umbenennen"} default items functionChoice with prompt "Funktion wählen:" OK button name "Weiter!"
|
ColorTool.applescript
|
if the functionChoice = {"Unbenuzte Farben löschen"} then
|
ColorTool.applescript
|
colorDeleteUnused(functionChoice) of me
|
ColorTool.applescript
|
else if the functionChoice = {"Unbenannte Farben hinzufügen"} then
|
ColorTool.applescript
|
colorAddUnnamed(functionChoice) of me
|
ColorTool.applescript
|
else if the functionChoice = {"Farben löschen und ersetzen"} then
|
ColorTool.applescript
|
colorDelete(functionChoice) of me
|
ColorTool.applescript
|
else if the functionChoice = {"Farben verteilen"} then
|
ColorTool.applescript
|
colorDistribute(functionChoice) of me
|
ColorTool.applescript
|
else if the functionChoice = {"Farbe umbenennen"} then
|
ColorTool.applescript
|
colorRename(functionChoice) of me
|
ColorTool.applescript
|
end functionChooser
|
ColorTool.applescript
|
on colorRename(functionChoice)
|
ColorTool.applescript
|
set buttonName to functionChoice & "!" as text
|
ColorTool.applescript
|
set chosenColor to choose from list (deduplicatedColorNames) default items chosenColor with prompt "Eine Farbe wählen:" OK button name buttonName without multiple selections allowed
|
ColorTool.applescript
|
my textInput()
|
ColorTool.applescript
|
set chosenColor to item 1 of chosenColor
|
ColorTool.applescript
|
set name of swatch chosenColor of openDocuments's item i to dieAntwort
|
ColorTool.applescript
|
set stopBool to true
|
ColorTool.applescript
|
end colorRename
|
ColorTool.applescript
|
on colorDeleteUnused(functionChoice)
|
ColorTool.applescript
|
display dialog "Unbenutzte Farben löschen?" buttons {"Stop", "Weiter"} default button "Weiter"
|
ColorTool.applescript
|
if button returned of result is "Weiter" then
|
ColorTool.applescript
|
delete unused swatches of item i of openDocuments
|
ColorTool.applescript
|
end colorDeleteUnused
|
ColorTool.applescript
|
on colorAddUnnamed(functionChoice)
|
ColorTool.applescript
|
display dialog "Unbenannte Farben hinzufügen?" buttons {"Stop", "Weiter"} default button "Weiter"
|
ColorTool.applescript
|
set myMenuAction to menu action "Unbenannte Farben hinzufügen"
|
ColorTool.applescript
|
set myKeyStrings to find key strings for title of myMenuAction
|
ColorTool.applescript
|
if class of myKeyStrings is list then
|
ColorTool.applescript
|
repeat with myKeyString in myKeyStrings
|
ColorTool.applescript
|
set myString to myKeyString & ""
|
ColorTool.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.