Script for deleting a pattern by name
I want to delete a pattern by using its name.
Thank so much for your prompt reply.
I am using Photoshop CS3 and i have converted this code to VB.Net, but i am getting error on below line
theNames(cnt) = patternNames.getString(cnt).
Error Message : General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
I think this function is not available in CS3. Would you please guide me on this error.
Thank you.
This is the code that i have converted.
'REM =======================================================
Dim objApp
objApp = CreateObject("Photoshop.Application")
'REM Use dialog mode 3 for show no dialogs
Dim dialogMode
dialogMode = 3
Dim desc5
desc5 = CreateObject("Photoshop.ActionDescriptor")
Dim ref1
ref1 = CreateObject("Photoshop.ActionReference")
Call ref1.PutProperty(objApp.StringIDToTypeID("property"), objApp.StringIDToTypeID("presetManager"))
Call ref1.PutEnumerated(objApp.charIDToTypeID("capp"), _
objApp.charIDToTypeID("Ordn"), _
objApp.charIDToTypeID("Trgt"))
Dim applicationDesc = objApp.executeActionGet(ref1)
Dim presetManager = applicationDesc.getList(objApp.stringIDToTypeID("presetManager"))
Dim patternNames = presetManager.getObjectValue(4).getList(objApp.stringIDToTypeID("name"))
Dim theNames(patternNames.count) As String
For cnt As Integer = 0 To patternNames.count
theNames(cnt) = patternNames.getString(cnt)
Next
MessageBox.Show(String.Join(",", theNames))
Similar Messages
-
Apple Script for deleting podcasts
I subscribe to a lot of podcasts, but I don't want to keep them in my iTunes library after I'm done listening to them. Is there an Apple Script for automatically deleting podcasts? Thanks.
Thanks - once I'm in Automator and select Music, I don't see any options for finding Podcasts. Any suggestions which item/step I should select next in Automator? Thanks.
-
Powershell script for deleting sitecollection and its content db
want to know whether any powershell script is avlble for deleting the sitecollection and its content db at oneshot!
i have created sitecollection specific content db and i wanna delete the same.Hi,
Below link will help to delete site collection
http://technet.microsoft.com/en-us/library/cc262392(v=office.15).aspx
Thanks
Somnath Matere -
Script for deleting objects on pasteboard
Anyone have a script that deletes all objects and text outside the page (or margins)?
Unfortunately in my Indi CS6 any pasteboard and spread item is "instance of spread".
So i consider geometrical bounds:
myDocument = app.activeDocument
cur_Ruler = myDocument.viewPreferences.rulerOrigin;
with(myDocument.viewPreferences){
rulerOrigin = RulerOrigin.spreadOrigin;}
myDocument.zeroPoint = [0,0];
aWidth = myDocument.documentPreferences.pageWidth*2+10;
var objs = app.documents[0].pageItems.everyItem().getElements();
while(obj=objs.pop()){
a_left = obj.geometricBounds[1];
a_right = obj.geometricBounds[3];
if(a_right <0 || a_left > aWidth){obj.remove()}
with(myDocument.viewPreferences){
rulerOrigin = cur_Ruler} //back to the RulerOrigin -
Script For Deleting Computers in SCCM 2012
Dears,
I need script to remove all the remain computers in SCCM 2012, sometimes we are going to delete some computers in active directory but the computers still remain in SCCM 2012, so I need script or query to find all the computers which removed from active
directory but still remain in SCCM 2012, because I don't want to go remove them manually one by one.'
Thanks..Thanks for article but below are not clear for me. I know only meaning of site code which I replaced with the script but is not working. My site code is "S01"
1- why there is two site codes?
2- Why there is two local domain names?
3- What dose mean by installdrive and why we have two?
# $sitecode = "<sitecode>:"
# $sitecode = "PS1:"
# $installdrive = "<ConfigMgr Admin Console installation>"
# $installdrive = "C:"
# $loglocation = "<loglocation>"
# $loglocation = "D:\Logfiles\"
# $localdomain = "<domainname>"
# $localdomain = "ConfigMgrLab"
# $maxdevices = <maximum number of devices in your ConfigMgr environment>
# $maxdevices = 2000 -
Hi All,
wen im loading the all the dimensions we have to delete all alises and reload all the dimensions
How can i delete alias for every load using maxl or any thing else
ThanksDear user98631,
I was going to refer you to this link: Re: HOW can i delete the members in dim using MAXL but I find that you are one and the same as the OP of that thread so you've already got the gen on what MaxL can and cannot do.
So, briefly, there is no MaxL command to delete aliases.
What you could do is create a dimension load rule that load blanks to aliases. This would require a rebuild of each dimension that you wanted to impact.
I'm a little confused, though.
You wrote:
wen im loading the all the dimensions we have to delete all alises and reload all the dimensions
How can i delete alias for every load using maxl or any thing else Do you want to delete the aliases from existing dimensions, or delete all of the dimensions and rebuild them from scratch?
If you want to do the latter, the previous thread linked above ought to do it. If you don't want aliases, just ignore the column with the aliases in your build table/file.
Does this answer your question?
Regards,
Cameron Lackpour -
Test script for syntax without running.
I have always wondered how to do this. Is there any way to have sql*plus check a script for correct syntax and column names, but NOT execute the code. I know that sql*plus doesn't have a TEST option, but it sure would be nice. Currently the only way to check code (especially updating code) is to let it rip and have a rollback at the end. Not the greatest way to do it.
EXPLAIN PLAN will only work for a single SQL statement.
If the script comprises a single transaction, one technique which might work is to first SET TRANSACTION READ ONLY.
This will attempt to execute every line in the script, but any statements which try to update the database will fail with "ORA-01456: may not perform insert/delete/update operation inside a READ ONLY transaction". Similar to what the original post described with a rollback at the end, but without the I/O. -
Sample Script to delete maps in FDQM
Hi All,
Can someone please provide us the sample script of deleting the Maps in FDQM.
Advanced Thanks,Hi Tony,
When we use this option(Delete All button on the mapping grid) we are getting the Stack trace error. we were suggested to use the script to delete the Maps in FDQM.
Error Message:
Application Error
Description: An exception occurred during the execution of the current web request. Please contact the administrator to review the stack trace in the event log for more information about the error.
Please provide the sample script for delete Maps in FDM.
Thanks in advance.
Edited by: venu_reddy on May 24, 2010 10:51 AM -
Looking for help with PowerShell script to delete folders in a Document Library
I'd like to create a PowerShell script to delete old folders in a Document library that are over 30 days old. Has anyone created something like this?
Orange County District AttorneyHello Sid:
I am trying to do the same and Iam running the script to delete the subfolders inside a folder but I have some errors.
Could you please take a look?
_______Script________
$web = Get-SPWeb -Identity https://myportal.mydomain.com
$list = $web.GetList("ar_mailingactivity")
$query = New-Object Microsoft.SharePoint.SPQuery
$camlQuery = '<Where><And><Eq><FieldRef Name="ContentType" /><Value Type="Computed">Folder</Value></Eq><Leq><FieldRef Name="Created" /><Value Type="DateTime"><Today OffsetDays="-30" /></Value></Leq></And></Where>'
$query.Query = $camlQuery
$items = $list.GetItems($query)
for ($intIndex = $items.Count - 1; $intIndex -gt -1; $intIndex--)
$items.Delete($intIndex);
________Errors_______
Unable to index into an object of type System.Management.Automation.PSMethod.
At C:\Script.ps1:2 char:22
+ $list =$webGetList <<<< "ar_mailingactivity"]
+ CategoryInfo
:InvalidOperation: (ar_mailingactivity:String) [], RuntimeException
+ FullyQualifiedErrorID
:CannotIndex
You cannot call a method on a null-valued expression.
At c:\Script.ps1:6 char:24
+ $items = $list.GetItems <<<< ($query)
+ CategoryInfo
:InvalidOperation: (GetItems:String) [], RuntimeException
+ FullyQualifiedErrorID
:InvokeMethodOnNull -
Popup Script for Save, edit & Delete Records
Hi Friends,
I developed an application, has got buttons like Save, edit, delete particular records. Is there any Java script for the above, to show popup Screens, like the confirm java script
<SCRIPT LANGUAGE="javascript">
<!--
function CONFIRM(){if (!confirm
("Are you Sure to Edit Record?Ok=Yes,Cancel=No "))
history.go(-1);return " "}
document.writeln(CONFIRM())
<!-- END -->
</SCRIPT>
pls mail me any sample code & Relevant weblogs regarding this.
Regards
CSM ReddyHi,
The following code will work... i have tested it.
<b>test.jsp</b>
<%@ page language="java" %>
<html>
<head>
<title>
TestForm
</title>
</head>
<script type="text/javascript">
function confirmSAVE() {
var save = confirm("Do u really want to save")
if (save){
alert("edit confirmed")
window.document.myForm.action="test.jsp"
window.document.myForm.submit()
else
alert("edit cancelled")
function confirmDelete() {
var del = confirm("Do u really want to delete")
if (del){
alert("del confirmed")
window.document.myForm.action="test.jsp"
window.document.myForm.submit()
else
alert("del cancelled")
</script>
<form name="myForm">
<body>
<table>
<tr>
<td colspan="2" align="center"><input type="button" style="background-color: #ffffff" name=save onclick="confirmSAVE()" value="SAVE">
</td>
<td colspan="2" align="center"><input type="button" style="background-color: #ffffff" name=delete onclick="confirmDelete()" value="DELETE">
</td>
</tr>
</table>
</body>
</form>
</html>
When you confirm edit or delete, the same test page will be displayed.
Regards,
Uma
Message was edited by: Uma Maheswari -
Scripts for adding/deleting/modifying Open Directory accounts?
I think I have searched high and low for an answer to this question, but if I missed it please point me in the right direction. Where can I find information on scripts for adding/deleting/modifying open directory accounts? At the very least, a command line utility with some syntax guidelines! Any help would be greatly appreciated.
Hi
I personally don't know if any scripts although you can use the command line to do pretty much anything you want with the Open Directory. Consult the manual: man dscl. If you launch terminal and issue dscl you should see something like this:
my-Laptop:~ me$ dscl
dscl (v20.4)
usage: dscl [options] [<datasource> [<command>]]
datasource:
localhost (default) or
<hostname> (requires DS proxy support, >= DS-158) or
<nodename> (Directory Service style node name) or
<domainname> (NetInfo style domain name)
options:
-u <user> authenticate as user (required when using DS Proxy)
-P <password> authentication password
-p prompt for password
-raw don't strip off prefix from DS constants
-url print record attribute values in URL-style encoding
-q quiet - no interactive prompt
commands:
-read <path> [<key>...]
-create <record path> [<key> [<val>...]]
-delete <path> [<key> [<val>...]]
-list <path> [<key>]
-append <record path> <key> <val>...
-merge <record path> <key> <val>...
-change <record path> <key> <old value> <new value>
-changei <record path> <key> <value index> <new value>
-search <path> <key> <val>
-auth [<user> [<password>]]
-authonly [<user> [<password>]]
-passwd <user path> [<new password> | <old password> <new password>]
Entering interactive mode...
The above is for 10.4 and should server equally as well for 10.5.
Hope this helps, Tony -
Script to delete files created on a specific date with sepecific name
Hi,
Is it possible to help me with a powershell script that delete files under a folder and subfolders that have the following attributes
1. have the name (default.*) and (index.*)
2. created on a specific date say 1-9-2014
3. created between specific time say between 10:00 - 16:00
Thanks in advance!break out the components of the script.
IE does this match
Get-ChildItem -Recurse c:\temp\*.*or Get-ChildItem -Recurse c:\temp\*.* | Where-Object {$_.CreationTime -gt (get-date "01-09-2014 10:00AM") -and $_.
CreationTime -lt (get-date "01-09-2014 14:00PM")}Get-ChildItem -Recurse c:\temp\*.* | Where-Object {$_.CreationTime -gt (get-date "01-09-2014 10:00AM") -and $_.
CreationTime -lt (get-date "01-09-2014 14:00PM")} | Where-Object {$_.name -match "default"}Might not be working as it might not be matching.Once you get it matching the remove-item will work.
Cheers,
Martin
Blog:
http://sustaslog.wordpress.com
LinkedIn:
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. -
Script for using layer name in Save for Web command
I am using the Save for Web command (Illustrator CS2) to export layers to CSS so that each layer is saved as a different jpg. The only issue I have is that I want the layer name to be part of the file name, but layer name is not an option when I look at the "Edit Output settings" dialog for saving files. Is there anyway I can do this? I do not have experience writing or working with scripts.
For example. My fiel name is flower.ai. I will have 20 different layers (each containing a different color of the same image) and want the exported file to be flower-scarlet.jpg, flower-cranberry,jpg, etc. Right now I am looking at renaming all the files manually, but as I am creating 40 images per product on my website, this will be very time consuming.
Thanks in advance
ChristineBtw.. to make it work for JPGs, change the PNG options to the following:
var options = new ExportOptionsJPEG();
options.antiAliasing = false;
options.optimization = false;
options.artBoardClipping = true;
options.qualitySetting = 100; // value of 0 to 100, 60 is medium, 100 is perfect
options.blurAmount = 0;
options.verticalScale = 100;
options.horizontalScale = 100; -
Hello Everybody, and thank you very much if you can answer to my little problem
So here is the beginning of my script. At the end it will be a script to batch convert Psd files to jpeg in different resolutions, in different folders.
I wanted to understand subtlety some parts of applescript, but I have to say that I failed for this case.
So the part I am looking for is to compare files between two folders, not exactly like syncing.
In the first Folder, psds files.
In the second, Jpgs, wich have been made from the psds, with a 2nd part of the script, batch to jpeg.
I want to compare these files to tell the 2nd script not to batch them to jpeg if they have not been modified.
So the steps I would like to write :
tell applescript to :
1 -
get every files of folder "psd" without invisibles
get only the names of these files without extension
get the modification date of these files
2-
get every files of folder "jpg" without invisibles
get only the names of these files without extension
get the modification date of these files
3- compare the names of the files in psd's and jpg's folders (it's why I didn't want the extension)
if some or all Psds already exist in jpg folder, then
compare the modification dates of these same files
and if these files in psd folder are more recent than in jpeg folder, then
get only these modified files in psd folder, and, also the new ones (not existing in jpg folder).
and --
4 - launch my batchconverttojpg for this result
(at this moment I only want to find steps 1, 2 and 3)
--- It is important for me to do that, because the files in psd's folder will always change, and I can have really big files (like 500 or 800 mo each), and it will be really faster to batch only modified files…
--- Here is the beginning of the script I am writing, but … bug bug bug, I don't find the good way to write that…
set folder1 to "Macintosh HD:Users:Me:Desktop:test batch convert-script:psds" as string
set folder2 to "Macintosh HD:Users:Me:Desktop:test batch convert-script:jpegs:Jpegs" as string
set AppleScript's text item delimiters to ""
tell application "System Events"
set imgsources to every file of folder folder1 whose name does not start with "." and (file type is "psd" or file type is "JPG" or name extension is "psd" or name extension is "jpg")
set imgcibles to every file of folder folder2 whose name does not start with "." and (file type is "psd" or file type is "JPG" or name extension is "psd" or name extension is "jpg")
end tell
--tell application "Finder"
repeat with i from 1 to the count of imgsources without invisibles
set img to (item i of imgsources as alias)
set infosource to info for img
set nameimg1 to name of infosource -- recupere le nom de limage + extension
--set extimg2 to items -1 thru -4 of nameimg2 as text -- recupere l'extension
set nimg1 to items 1 thru -5 of nameimg1 as text -- recupere le nom
set moddateimg1 to modification date of infosource -- recupere la date de modif
repeat with i from 1 to the count of imgcibles without invisibles
set img2 to (item i of imgcibles as list) -- recupere tous les elements du dossier
set infocible to info for img2 -- recupere les infos
set nameimg2 to name of infocible -- recupere le nom de limage de destination
set extimg2 to items -1 thru -4 of nameimg2 as text -- recupere l'extension
set nimg2 to items 1 thru -5 of nameimg2 as text -- recupere le nom
set moddateimg2 to modification date of infocible -- recupere la date de modif
tell application "Finder"
if nimg1 = nimg2 as text then
--set nimg1 to nimg1 as string
--set nimg2 to nimg2 as string
--set name of img2 to folder2 & ":" & nimg2 & "-" & "2" & extimg2 as text
set name of img2 to nimg2 & "-" & "2" & extimg2
-- I am just trying to rename the file at this step.
-- After this, I will compare the dates, and then, batch convert.
end if
end tell
end repeat
end repeat
So if one of you have the good solution It will be a miracle for me
I have to say that if I wrote this script in a simple way like that, it's to be able to understand what I do, or to understand the script after 6 month, without thinking about it…
Thank you very much for your answers
FredOk so there are a lot of things I didn't know about some details… And I see that I will never have succeed to write something like that…
I don't really understand why to "set psdNames to --> {}" this last detail is unknown for me…
And if I understand, the thing I missed is to do a listindex of the items ? it's why I didn't succeed to compare the files ?
Then I though that it could be interesting for you or differents users to see the result. I think it works perfectly now.
Of course, I am not professional in applescript editing, so if you have some comments or modifications, do not hesitate to post them here
Thanks again to Red_Menace !
Fred
Here it is :
(sorry I didnt translate all the notes to English. Just have to know that the script proceed in the folder where it is. If it's not save in the good folder before execute, or save as application in the good folder, then it will proceed in the default folder "applications"... so careful
display dialog " Attention, Le script va créer un dossier psd, et déplacer les fichiers psds ici dans ce nouveau dossier" & return & " Et va ensuite procéder à la création de" & return & " Jpegs dans différents dossiers" buttons {"Ok", "Annuler", "+ d'explications"} default button "OK"
if button returned of the result is "+ d'explications" then
explications()
return
end if
--Application utilisée : adobe photoshop CS3
--Changer la version si besoin dans les lignes ci dessous
--Changer le nom des dossiers ici, sans avoir à changer le reste du script
set nomdossierpsds to "psds"
set psdsFolder to nomdossierpsds
set tempFolderName to "Exports"
set tempfoldername1 to "Jpegs_HD"
set tempfoldername2 to "Jpegs_SD"
--Pour changer la taille des Jpegs SD --
set choixtaille to "1200"
tell application "Finder"
set racine to get folder of (path to me) as Unicode text
set nomprojet to name of folder racine
--if folder psd exists but with different case
if exists folder "psd" in folder racine then
set name of folder "psd" in folder racine to psdsFolder
end if
if exists folder "Psd" in folder racine then
set name of folder "psd" in folder racine to psdsFolder
end if
if exists folder "Psds" in folder racine then
set name of folder "Psds" in folder racine to psdsFolder
end if
--2 -- check si le dossier psd existe, sinon le crée.
if not (exists folder psdsFolder in folder racine) then
make new folder in folder racine with properties {name:psdsFolder}
set psdsFolder to folder psdsFolder in folder racine as alias
open folder psdsFolder
--display dialog "Avant de Continuer, Placer les images dans le dossier Psds" buttons {"Annuler"} default button 1
else
set psdsFolder to folder (racine & "psds") as alias
end if
--if Psd folder didnt exists, then move psd files in
set psds to (files of folder racine whose name extension is "psd")
move psds to folder psdsFolder
--Dossier Jpegs Racine -- outputFolder -- check si present sinon creation
if not (exists folder ((racine as string) & tempFolderName)) then
set outputFolder to make new folder at racine with properties {name:tempFolderName}
else
set outputFolder to folder ((racine as string) & tempFolderName)
end if
--Dossier Jpegs HD -- outputFolder1 pour photoshop -- check si present sinon creation
if not (exists folder (((racine as string) & tempFolderName as string) & ":" & tempfoldername1)) then
set outputFolder1 to make new folder at outputFolder with properties {name:tempfoldername1}
else
set outputFolder1 to folder ((racine as string) & tempFolderName & ":" & tempfoldername1)
end if
set outputFolder1 to outputFolder1 as alias
--Dossier Jpegs SD -- outputFolder2 pour photoshop -- check si present sinon creation
if not (exists folder (((racine as string) & tempFolderName as string) & ":" & tempfoldername2)) then
set outputFolder2 to make new folder at outputFolder with properties {name:tempfoldername2}
else
set outputFolder2 to folder ((racine as string) & tempFolderName & ":" & tempfoldername2)
end if
set outputFolder2 to outputFolder2 as alias
end tell
--recupere le chemin du dossier des psds à procéder
tell application "Finder"
set psdsFolder to folder (racine & nomdossierpsds) as alias
end tell
--1
tell application "Finder" -- get file items from the folders (coerce list items to aliases for use later)
set psdFiles to (files of folder psdsFolder whose name extension is "psd") as alias list
set jpgFiles to (files of folder outputFolder1 whose name extension is "jpg" or name extension is "psd") as alias list
end tell
--2
set psdNames to {} -- get the psd file names (these are in the same order as the file items)
repeat with anItem in psdFiles
set the end of psdNames to (justTheName from anItem)
end repeat
set jpgNames to {} -- get the jpg file names (these are in the same order as the file items)
repeat with anItem in jpgFiles
set the end of jpgNames to (justTheName from anItem)
end repeat
--3
set filesList to {} -- figure out the files to process
repeat with X from 1 to (count psdNames)
set theName to contents of (item X of psdNames) -- get a name from the psd list
if theName is in jpgNames then -- found a jpg match, so check the date
set match to (listIndex of theName from jpgNames) -- get the index of the matching name
tell application "Finder" -- look up the file items for the matching names and get the dates
set psdDate to modification date of (item X of psdFiles)
set jpgDate to modification date of (item match of jpgFiles)
end tell
if psdDate > jpgDate then set the end of filesList to (item X of psdFiles) -- newer file, so add
else -- no match, so add
set the end of filesList to (item X of psdFiles)
end if
end repeat
filesList --> this list contains items (aliases) that are not in jpgsFolder or have a newer modification date
tell application "Adobe Photoshop CS3"
activate
set display dialogs to never
close every document saving no
end tell
repeat with aFile in filesList
set fileIndex to 0
tell application "Finder"
-- The step below is important because the 'aFile' reference as returned by
-- Finder associates the file with Finder and not Photoshop. By converting
-- the reference below 'as alias', the reference used by 'open' will be
-- correctly handled by Photoshop rather than Finder.
set theFile to aFile as alias
set theFileName to name of theFile
end tell
tell application "Adobe Photoshop CS3"
activate
open theFile
set docRef to the current document
set docHeight to height of docRef
set docWidth to width of docRef
------------------------------------------------------------------- 1st Export to jpeg
--Convert the document to a document mode that supports saving as jpeg
flatten docRef
tell docRef to convert to profile "sRGB IEC61966-2.1" intent perceptual with dithering and blackpoint compensation
if (bits per channel of docRef is sixteen) then
set bits per channel of docRef to eight
end if
--The first copy is simply saved with additional document info added
set infoRef to get info of docRef
set copyright notice of infoRef to "Copyright Frédéric Perrin"
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
--set fileIndex to fileIndex + 1
set newFileName to (outputFolder1 as string) & docBaseName & ".jpg"
save docRef in file newFileName as JPEG appending lowercase extension with options {class:JPEG save options, quality:12, format options:optimized}
------------------------------------------------------------------- 2nd export to jpeg
-- The second copy is saved resized to width of 100 pixels proportionally
-- There is no scale constraint in the resize image command.
-- Use the height/width ratio to simulate the option.
set ruler units of settings to pixel units
set type units of settings to pixel units
resize image current document width choixtaille height (choixtaille * docHeight / docWidth)
-- repete la mise en memoire des variables, sinon des bugs
set docRef to the current document
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
--set fileIndex to fileIndex + 1
set newFileName2 to (outputFolder2 as string) & docBaseName & "-" & choixtaille & ".jpg"
save docRef in file newFileName2 as JPEG appending lowercase extension --with options {class:JPEG save options, quality:12, format options:optimized}
-- The original document is closed without saving so it remains as it was
-- when opened for batch processing
close current document without saving
end tell
end repeat
-- Routines
-- Returns the document name without extension (if present)
on getBaseName(fName)
set baseName to fName
repeat with idx from 1 to (length of fName)
if (item idx of fName = ".") then
set baseName to (items 1 thru (idx - 1) of fName) as string
exit repeat
end if
end repeat
return baseName
end getBaseName
on justTheName from someFile
get the name from a file path
parameters - someFile [various]: a complete file path (POSIX or Finder)
returns [text] - the base file name
set someFile to someFile as text
tell application "System Events" to tell disk item someFile
set {theName, theExtension} to {name, name extension}
end tell
if theExtension is in {missing value, ""} then
set theExtension to ""
else
set theExtension to "." & theExtension
end if
return text 1 thru -((count theExtension) + 1) of theName -- just the name part
end justTheName
to listIndex of anItem from someList
get the (first) index of anItem in someList
parameters - anItem [various]: the item to look for
someList [list]: the list to look in
returns [integer]: the index (0 if not found)
set theIndex to 0
repeat with X from 1 to (count someList)
if (contents of (item X of someList)) is anItem then
set theIndex to X
exit repeat
end if
end repeat
return theIndex
end listIndex
on explications()
tell application "TextEdit"
activate
make new document
set text of front document to ¬
"--- Attention --- Le Script se lance pour gérer le dossier dans lequel il se trouve." & return & return & ¬
"Pour ne plus voir ce message, ouvrir le script/application et l'éditer avec un éditeur comme Editeur applescript : Effacer alors le premier paragraphe --> End Message" & return & return & return & ¬
"Il vérifie l'existence d'un dossier Psd, s'il existe, mais pas dans la bonne casse, renomme le dossier --" & return & "Donc -- attention -- si d'autres scripts sont chainés à ce dossier, il faudra mettre à jour la casse ou orthographe, sinon changer les variables en début de script afin que tous les scripts marchent avec le meme nom de ce dossier psd" & return & return & ¬
"Une fois cela géré, le dossier -psds- est créé, sil n'est pas deja la. Les fichiers psds pouvant être présents à la racine du dossier, où se trouve le script, seront déplacés dans le dossier psd" & return & ¬
"Ensuite, création d'un dossier jpeg contenant deux autres dossiers : jpgs HD et Sd, le 1er contiendra les jpegs à la resolution source du psd, le dossier Sd à la résolution de 1200px, soit acceptable pour le web ou le partage temporaire" & return & return & ¬
"Pour finir, le script peut être relancé à l'infini, les dossiers se synchronisent en fonction du dossier Psd et JpegsHD. Si de nouveaux fichiers se trouvent dans le dossier Psd, ou bien sils ont été modifiés, alors ils seront re-batchés en jpegs dans les dossiers correspondants." & return & ¬
"Donc -- Attention -- , ne jamais faire de retouches sur les fichiers Jpegs, seulement sur les psds, et -- attention-- aussi, les fichiers jpegs correspondants aux psds retouchés seront écrasés" & return & ¬
"Pour conserver des versions des fichiers, à la main, renommer séquentiellement les psds à l'enregistrement dans photoshop, ainsi les jpegs seront séquentiels aussi" & return & return & return & ¬
"La préférence, de choisir à la main la séquence des fichiers psds semble être plus pratique à l'usage, et de garder un minimum la main sur les images, afin de s'y retrouver" & return & return & return
end tell
end explications
------------------------------------------------------------------- -
Script for document name labels
How hard would this be?
A script that would type the file name into the document. I searched for similar threads but no luck. Here are the details...
1. If the document was named TEST.pdf the script would type TEST in the document.
2. The font color, size, and type would be Black, Arial Bold, 0.4 in.
3. The font would be converted to outlines.
4. A rectangle 0.05" larger than text would be placed around the text.
5. The rectangle would have no fill and a 100% magenta spot color named "CC" stroke.
6. The rectangle stroke would be moved to the CC layer (pre-existing layer).
7. The text "TEST" would be moved to the Artwork layer (pre-existing layer).
Thanks for any input or help.
AntonAnton, this should be pretty close for a guide… I don't know what your exact font name would be… so this uses my closest match. Also you don't mention text positioning on the artboard/doc… The stroke is default 1pt as is. The height of the outlined text would be dependent on your font and you may have to tinker with the size where shown…
#target illustrator
function docNameToText() {
if (app.documents.length = 0) {
return;
} else {
var docRef = app.activeDocument;
var docName = docRef.name;
var text = docName.replace(/\.(ai|eps|pdf)$/i,'');
var arialFont = app.textFonts.getByName('ArialMT-Bold'); // Add font name here…
var nameText = docRef.textFrames.add();
nameText.contents = text;
var nameChar = nameText.lines[0].characters;
for (var i = 0; i < nameChar.length; i++) {
nameChar[i].characterAttributes.textFont = arialFont;
nameChar[i].characterAttributes.size = 40; // Adjust font size here…
var textGroup = nameText.createOutline();
textGroup.position = [36,-36]; // Half Inch down/across from top/left
var groupBounds = textGroup.visibleBounds;
var ccLayer = docRef.layers.getByName('CC');
textGroup.move(ccLayer, ElementPlacement.INSIDE);
var artLayer = docRef.layers.getByName('Artwork');
// This can't be the right way to do this now can it?
var boxTop = groupBounds[1] + 4;
var boxLeft = groupBounds[0] - 4;
var boxWidth = (groupBounds[2] - groupBounds[0]) + 8;
var boxHeight = (-groupBounds[3] - -groupBounds[1]) + 8;
var spotBox = docRef.pathItems.rectangle(boxTop,boxLeft,boxWidth,boxHeight);
spotBox.filled = false;
spotBox.stroked = true;
//spotBox.strokeWidth = 1; // Default is 1pt
var ccSpot = docRef.swatches.getByName('CC');
spotBox.strokeColor = ccSpot.color;
textGroup.move(artLayer, ElementPlacement.INSIDE);
docNameToText();
Maybe you are looking for
-
Cannot apply OS image to lenovo with usb Ethernet
Greetings, We have a Windows 8.1 task sequence which works fine on over a dozen laptops that have an ethernet adapter. We recently acquired a Lenovo Helix machine that doesnt have an inbuilt adapter but has a usb ethernet adapter. I found the drive
-
Can't reset Open Firmware!
I have a 1GHz titanium, and it has the 'sleep of death' problem - blank screen on opening the lid from sleep. (Only happens intermittently.) It has several other 'issues' lately that are driving me nuts, but one at a time. I would like to reset the o
-
Mission Control vs Spaces. Was this an upgrade?
In spaces, I could see which space that I was in by looking at menu bar. Apparently this does not happen with Mission Control. I work most of the time with two monitors and with spaces I could move any window to the space on either monitor. With M
-
Skype camera showing gray screen
When i skype with people we can hear each other just fine. I can see them perfectly but they do not seem to see me. On their screen its black with a loading button in the middle of the screen. I can't figure out how to fix it. I have literally done j
-
Installing The Oracle Internet File System
i can't connect internal on linux